Cody

Solution 739110

Submitted on 18 Sep 2015 by Binbin Qi
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
%% n = 30; b = 1; A_correct = [ 30 ]; assert(isequal(LtdFactor(n,b),A_correct))

[Warning: Duplicate directory name: /opt/mlsedu/matlab/R2015b/toolbox/stateflow/stateflow] ---------------------------------------------------------------------------------------------------- MATLAB Version: 8.6.0.267246 (R2015b) MATLAB License Number: 35 Operating System: Linux 3.17.8-031708-generic #201501081837 SMP Thu Jan 8 18:39:03 UTC 2015 x86_64 Java Version: Java 1.7.0_60-b19 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode ---------------------------------------------------------------------------------------------------- MATLAB Version 8.6 (R2015b) Simulink Version 8.6 (R2015b) Aerospace Blockset Version 3.16 (R2015b) Aerospace Toolbox Version 2.16 (R2015b) Antenna Toolbox Version 1.1 (R2015b) Bioinformatics Toolbox Version 4.5.2 (R2015b) Communications System Toolbox Version 6.1 (R2015b) Computer Vision System Toolbox Version 7.0 (R2015b) Control System Toolbox Version 9.10 (R2015b) Curve Fitting Toolbox Version 3.5.2 (R2015b) DO Qualification Kit Version 3.0 (R2015b) DSP System Toolbox Version 9.1 (R2015b) Database Toolbox Version 6.0 (R2015b) Datafeed Toolbox Version 5.2 (R2015b) Econometrics Toolbox Version 3.3 (R2015b) Embedded Coder Version 6.9 (R2015b) Filter Design HDL Coder Version 2.10 (R2015b) Financial Instruments Toolbox Version 2.2 (R2015b) Financial Toolbox Version 5.6 (R2015b) Fixed-Point Designer Version 5.1 (R2015b) Fuzzy Logic Toolbox Version 2.2.22 (R2015b) Global Optimization Toolbox Version 3.3.2 (R2015b) HDL Coder Version 3.7 (R2015b) HDL Verifier Version 4.7 (R2015b) IEC Certification Kit Version 3.6 (R2015b) Image Acquisition Toolbox Version 4.10 (R2015b) Image Processing Toolbox Version 9.3 (R2015b) Instrument Control Toolbox Version 3.8 (R2015b) LTE System Toolbox Version 2.1 (R2015b) MATLAB Coder Version 3.0 (R2015b) MATLAB Compiler Version 6.1 (R2015b) MATLAB Compiler SDK Version 6.1 (R2015b) MATLAB Distributed Computing Server Version 6.7 (R2015b) MATLAB Report Generator Version 4.2 (R2015b) Mapping Toolbox Version 4.2 (R2015b) Model Predictive Control Toolbox Version 5.1 (R2015b) Neural Network Toolbox Version 8.4 (R2015b) Optimization Toolbox Version 7.3 (R2015b) Parallel Computing Toolbox Version 6.7 (R2015b) Partial Differential Equation Toolbox Version 2.1 (R2015b) Phased Array System Toolbox Version 3.1 (R2015b) Polyspace Bug Finder Version 2.0 (R2015b) Polyspace Code Prover Version 9.4 (R2015b) RF Toolbox Version 2.17 (R2015b) Robotics System Toolbox Version 1.1 (R2015b) Robust Control Toolbox Version 6.0 (R2015b) Signal Processing Toolbox Version 7.1 (R2015b) SimBiology Version 5.3 (R2015b) SimDriveline Version 2.9 (R2015b) SimElectronics Version 2.8 (R2015b) SimEvents Version 4.4.1 (R2015b) SimHydraulics Version 1.17 (R2015b) SimMechanics Version 4.7 (R2015b) SimPowerSystems Version 6.4 (R2015b) SimRF Version 4.5 (R2015b) Simscape Version 3.14 (R2015b) Simulink 3D Animation Version 7.4 (R2015b) Simulink Code Inspector Version 2.4 (R2015b) Simulink Coder Version 8.9 (R2015b) Simulink Control Design Version 4.2.1 (R2015b) Simulink Design Optimization Version 2.8 (R2015b) Simulink Design Verifier Version 3.0 (R2015b) Simulink Report Generator Version 4.2 (R2015b) Simulink Test Version 1.1 (R2015b) Simulink Verification and Validation Version 3.10 (R2015b) Stateflow Version 8.6 (R2015b) Statistics and Machine Learning Toolbox Version 10.1 (R2015b) Symbolic Math Toolbox Version 6.3 (R2015b) System Identification Toolbox Version 9.3 (R2015b) SystemTest Version 2.6.10 (R2015b) Vision HDL Toolbox Version 1.1 (R2015b) Wavelet Toolbox Version 4.15 (R2015b)

2   Pass
%% n = 3135; b = 2; A_correct = [ 1 3135 ; 3 1045 ; 5 627 ; 11 285 ; 15 209 ; 19 165 ; 33 95 ; 55 57 ]; assert(isequal(LtdFactor(n,b),A_correct))

[Warning: Duplicate directory name: /opt/mlsedu/matlab/R2015b/toolbox/stateflow/stateflow] ---------------------------------------------------------------------------------------------------- MATLAB Version: 8.6.0.267246 (R2015b) MATLAB License Number: 35 Operating System: Linux 3.17.8-031708-generic #201501081837 SMP Thu Jan 8 18:39:03 UTC 2015 x86_64 Java Version: Java 1.7.0_60-b19 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode ---------------------------------------------------------------------------------------------------- MATLAB Version 8.6 (R2015b) Simulink Version 8.6 (R2015b) Aerospace Blockset Version 3.16 (R2015b) Aerospace Toolbox Version 2.16 (R2015b) Antenna Toolbox Version 1.1 (R2015b) Bioinformatics Toolbox Version 4.5.2 (R2015b) Communications System Toolbox Version 6.1 (R2015b) Computer Vision System Toolbox Version 7.0 (R2015b) Control System Toolbox Version 9.10 (R2015b) Curve Fitting Toolbox Version 3.5.2 (R2015b) DO Qualification Kit Version 3.0 (R2015b) DSP System Toolbox Version 9.1 (R2015b) Database Toolbox Version 6.0 (R2015b) Datafeed Toolbox Version 5.2 (R2015b) Econometrics Toolbox Version 3.3 (R2015b) Embedded Coder Version 6.9 (R2015b) Filter Design HDL Coder Version 2.10 (R2015b) Financial Instruments Toolbox Version 2.2 (R2015b) Financial Toolbox Version 5.6 (R2015b) Fixed-Point Designer Version 5.1 (R2015b) Fuzzy Logic Toolbox Version 2.2.22 (R2015b) Global Optimization Toolbox Version 3.3.2 (R2015b) HDL Coder Version 3.7 (R2015b) HDL Verifier Version 4.7 (R2015b) IEC Certification Kit Version 3.6 (R2015b) Image Acquisition Toolbox Version 4.10 (R2015b) Image Processing Toolbox Version 9.3 (R2015b) Instrument Control Toolbox Version 3.8 (R2015b) LTE System Toolbox Version 2.1 (R2015b) MATLAB Coder Version 3.0 (R2015b) MATLAB Compiler Version 6.1 (R2015b) MATLAB Compiler SDK Version 6.1 (R2015b) MATLAB Distributed Computing Server Version 6.7 (R2015b) MATLAB Report Generator Version 4.2 (R2015b) Mapping Toolbox Version 4.2 (R2015b) Model Predictive Control Toolbox Version 5.1 (R2015b) Neural Network Toolbox Version 8.4 (R2015b) Optimization Toolbox Version 7.3 (R2015b) Parallel Computing Toolbox Version 6.7 (R2015b) Partial Differential Equation Toolbox Version 2.1 (R2015b) Phased Array System Toolbox Version 3.1 (R2015b) Polyspace Bug Finder Version 2.0 (R2015b) Polyspace Code Prover Version 9.4 (R2015b) RF Toolbox Version 2.17 (R2015b) Robotics System Toolbox Version 1.1 (R2015b) Robust Control Toolbox Version 6.0 (R2015b) Signal Processing Toolbox Version 7.1 (R2015b) SimBiology Version 5.3 (R2015b) SimDriveline Version 2.9 (R2015b) SimElectronics Version 2.8 (R2015b) SimEvents Version 4.4.1 (R2015b) SimHydraulics Version 1.17 (R2015b) SimMechanics Version 4.7 (R2015b) SimPowerSystems Version 6.4 (R2015b) SimRF Version 4.5 (R2015b) Simscape Version 3.14 (R2015b) Simulink 3D Animation Version 7.4 (R2015b) Simulink Code Inspector Version 2.4 (R2015b) Simulink Coder Version 8.9 (R2015b) Simulink Control Design Version 4.2.1 (R2015b) Simulink Design Optimization Version 2.8 (R2015b) Simulink Design Verifier Version 3.0 (R2015b) Simulink Report Generator Version 4.2 (R2015b) Simulink Test Version 1.1 (R2015b) Simulink Verification and Validation Version 3.10 (R2015b) Stateflow Version 8.6 (R2015b) Statistics and Machine Learning Toolbox Version 10.1 (R2015b) Symbolic Math Toolbox Version 6.3 (R2015b) System Identification Toolbox Version 9.3 (R2015b) SystemTest Version 2.6.10 (R2015b) Vision HDL Toolbox Version 1.1 (R2015b) Wavelet Toolbox Version 4.15 (R2015b)

3   Pass
%% n = 120; b = 3; A_correct = [ 1 1 120 ; 1 2 60 ; 1 3 40 ; 1 4 30 ; 1 5 24 ; 1 6 20 ; 1 8 15 ; 1 10 12 ; 2 2 30 ; 2 3 20 ; 2 4 15 ; 2 5 12 ; 2 6 10 ; 3 4 10 ; 3 5 8 ; 4 5 6 ]; assert(isequal(LtdFactor(n,b),A_correct))

[Warning: Duplicate directory name: /opt/mlsedu/matlab/R2015b/toolbox/stateflow/stateflow] ---------------------------------------------------------------------------------------------------- MATLAB Version: 8.6.0.267246 (R2015b) MATLAB License Number: 35 Operating System: Linux 3.17.8-031708-generic #201501081837 SMP Thu Jan 8 18:39:03 UTC 2015 x86_64 Java Version: Java 1.7.0_60-b19 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode ---------------------------------------------------------------------------------------------------- MATLAB Version 8.6 (R2015b) Simulink Version 8.6 (R2015b) Aerospace Blockset Version 3.16 (R2015b) Aerospace Toolbox Version 2.16 (R2015b) Antenna Toolbox Version 1.1 (R2015b) Bioinformatics Toolbox Version 4.5.2 (R2015b) Communications System Toolbox Version 6.1 (R2015b) Computer Vision System Toolbox Version 7.0 (R2015b) Control System Toolbox Version 9.10 (R2015b) Curve Fitting Toolbox Version 3.5.2 (R2015b) DO Qualification Kit Version 3.0 (R2015b) DSP System Toolbox Version 9.1 (R2015b) Database Toolbox Version 6.0 (R2015b) Datafeed Toolbox Version 5.2 (R2015b) Econometrics Toolbox Version 3.3 (R2015b) Embedded Coder Version 6.9 (R2015b) Filter Design HDL Coder Version 2.10 (R2015b) Financial Instruments Toolbox Version 2.2 (R2015b) Financial Toolbox Version 5.6 (R2015b) Fixed-Point Designer Version 5.1 (R2015b) Fuzzy Logic Toolbox Version 2.2.22 (R2015b) Global Optimization Toolbox Version 3.3.2 (R2015b) HDL Coder Version 3.7 (R2015b) HDL Verifier Version 4.7 (R2015b) IEC Certification Kit Version 3.6 (R2015b) Image Acquisition Toolbox Version 4.10 (R2015b) Image Processing Toolbox Version 9.3 (R2015b) Instrument Control Toolbox Version 3.8 (R2015b) LTE System Toolbox Version 2.1 (R2015b) MATLAB Coder Version 3.0 (R2015b) MATLAB Compiler Version 6.1 (R2015b) MATLAB Compiler SDK Version 6.1 (R2015b) MATLAB Distributed Computing Server Version 6.7 (R2015b) MATLAB Report Generator Version 4.2 (R2015b) Mapping Toolbox Version 4.2 (R2015b) Model Predictive Control Toolbox Version 5.1 (R2015b) Neural Network Toolbox Version 8.4 (R2015b) Optimization Toolbox Version 7.3 (R2015b) Parallel Computing Toolbox Version 6.7 (R2015b) Partial Differential Equation Toolbox Version 2.1 (R2015b) Phased Array System Toolbox Version 3.1 (R2015b) Polyspace Bug Finder Version 2.0 (R2015b) Polyspace Code Prover Version 9.4 (R2015b) RF Toolbox Version 2.17 (R2015b) Robotics System Toolbox Version 1.1 (R2015b) Robust Control Toolbox Version 6.0 (R2015b) Signal Processing Toolbox Version 7.1 (R2015b) SimBiology Version 5.3 (R2015b) SimDriveline Version 2.9 (R2015b) SimElectronics Version 2.8 (R2015b) SimEvents Version 4.4.1 (R2015b) SimHydraulics Version 1.17 (R2015b) SimMechanics Version 4.7 (R2015b) SimPowerSystems Version 6.4 (R2015b) SimRF Version 4.5 (R2015b) Simscape Version 3.14 (R2015b) Simulink 3D Animation Version 7.4 (R2015b) Simulink Code Inspector Version 2.4 (R2015b) Simulink Coder Version 8.9 (R2015b) Simulink Control Design Version 4.2.1 (R2015b) Simulink Design Optimization Version 2.8 (R2015b) Simulink Design Verifier Version 3.0 (R2015b) Simulink Report Generator Version 4.2 (R2015b) Simulink Test Version 1.1 (R2015b) Simulink Verification and Validation Version 3.10 (R2015b) Stateflow Version 8.6 (R2015b) Statistics and Machine Learning Toolbox Version 10.1 (R2015b) Symbolic Math Toolbox Version 6.3 (R2015b) System Identification Toolbox Version 9.3 (R2015b) SystemTest Version 2.6.10 (R2015b) Vision HDL Toolbox Version 1.1 (R2015b) Wavelet Toolbox Version 4.15 (R2015b)

4   Pass
%% n = 420; b = 4; A_correct = [ 1 1 1 420 ; 1 1 2 210 ; 1 1 3 140 ; 1 1 4 105 ; 1 1 5 84 ; 1 1 6 70 ; 1 1 7 60 ; 1 1 10 42 ; 1 1 12 35 ; 1 1 14 30 ; 1 1 15 28 ; 1 1 20 21 ; 1 2 2 105 ; 1 2 3 70 ; 1 2 5 42 ; 1 2 6 35 ; 1 2 7 30 ; 1 2 10 21 ; 1 2 14 15 ; 1 3 4 35 ; 1 3 5 28 ; 1 3 7 20 ; 1 3 10 14 ; 1 4 5 21 ; 1 4 7 15 ; 1 5 6 14 ; 1 5 7 12 ; 1 6 7 10 ; 2 2 3 35 ; 2 2 5 21 ; 2 2 7 15 ; 2 3 5 14 ; 2 3 7 10 ; 2 5 6 7 ; 3 4 5 7 ]; assert(isequal(LtdFactor(n,b),A_correct))

[Warning: Duplicate directory name: /opt/mlsedu/matlab/R2015b/toolbox/stateflow/stateflow] ---------------------------------------------------------------------------------------------------- MATLAB Version: 8.6.0.267246 (R2015b) MATLAB License Number: 35 Operating System: Linux 3.17.8-031708-generic #201501081837 SMP Thu Jan 8 18:39:03 UTC 2015 x86_64 Java Version: Java 1.7.0_60-b19 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode ---------------------------------------------------------------------------------------------------- MATLAB Version 8.6 (R2015b) Simulink Version 8.6 (R2015b) Aerospace Blockset Version 3.16 (R2015b) Aerospace Toolbox Version 2.16 (R2015b) Antenna Toolbox Version 1.1 (R2015b) Bioinformatics Toolbox Version 4.5.2 (R2015b) Communications System Toolbox Version 6.1 (R2015b) Computer Vision System Toolbox Version 7.0 (R2015b) Control System Toolbox Version 9.10 (R2015b) Curve Fitting Toolbox Version 3.5.2 (R2015b) DO Qualification Kit Version 3.0 (R2015b) DSP System Toolbox Version 9.1 (R2015b) Database Toolbox Version 6.0 (R2015b) Datafeed Toolbox Version 5.2 (R2015b) Econometrics Toolbox Version 3.3 (R2015b) Embedded Coder Version 6.9 (R2015b) Filter Design HDL Coder Version 2.10 (R2015b) Financial Instruments Toolbox Version 2.2 (R2015b) Financial Toolbox Version 5.6 (R2015b) Fixed-Point Designer Version 5.1 (R2015b) Fuzzy Logic Toolbox Version 2.2.22 (R2015b) Global Optimization Toolbox Version 3.3.2 (R2015b) HDL Coder Version 3.7 (R2015b) HDL Verifier Version 4.7 (R2015b) IEC Certification Kit Version 3.6 (R2015b) Image Acquisition Toolbox Version 4.10 (R2015b) Image Processing Toolbox Version 9.3 (R2015b) Instrument Control Toolbox Version 3.8 (R2015b) LTE System Toolbox Version 2.1 (R2015b) MATLAB Coder Version 3.0 (R2015b) MATLAB Compiler Version 6.1 (R2015b) MATLAB Compiler SDK Version 6.1 (R2015b) MATLAB Distributed Computing Server Version 6.7 (R2015b) MATLAB Report Generator Version 4.2 (R2015b) Mapping Toolbox Version 4.2 (R2015b) Model Predictive Control Toolbox Version 5.1 (R2015b) Neural Network Toolbox Version 8.4 (R2015b) Optimization Toolbox Version 7.3 (R2015b) Parallel Computing Toolbox Version 6.7 (R2015b) Partial Differential Equation Toolbox Version 2.1 (R2015b) Phased Array System Toolbox Version 3.1 (R2015b) Polyspace Bug Finder Version 2.0 (R2015b) Polyspace Code Prover Version 9.4 (R2015b) RF Toolbox Version 2.17 (R2015b) Robotics System Toolbox Version 1.1 (R2015b) Robust Control Toolbox Version 6.0 (R2015b) Signal Processing Toolbox Version 7.1 (R2015b) SimBiology Version 5.3 (R2015b) SimDriveline Version 2.9 (R2015b) SimElectronics Version 2.8 (R2015b) SimEvents Version 4.4.1 (R2015b) SimHydraulics Version 1.17 (R2015b) SimMechanics Version 4.7 (R2015b) SimPowerSystems Version 6.4 (R2015b) SimRF Version 4.5 (R2015b) Simscape Version 3.14 (R2015b) Simulink 3D Animation Version 7.4 (R2015b) Simulink Code Inspector Version 2.4 (R2015b) Simulink Coder Version 8.9 (R2015b) Simulink Control Design Version 4.2.1 (R2015b) Simulink Design Optimization Version 2.8 (R2015b) Simulink Design Verifier Version 3.0 (R2015b) Simulink Report Generator Version 4.2 (R2015b) Simulink Test Version 1.1 (R2015b) Simulink Verification and Validation Version 3.10 (R2015b) Stateflow Version 8.6 (R2015b) Statistics and Machine Learning Toolbox Version 10.1 (R2015b) Symbolic Math Toolbox Version 6.3 (R2015b) System Identification Toolbox Version 9.3 (R2015b) SystemTest Version 2.6.10 (R2015b) Vision HDL Toolbox Version 1.1 (R2015b) Wavelet Toolbox Version 4.15 (R2015b)

5   Fail