Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Incorrect

18Size
Leading solution size is 20.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test
Code Input and Output
1
Fail
 
%%
x = 0;
y_correct = 1;
assert(isequal(pow2_sumofdigits(x),y_correct))
Error: License checkout failed.
License Manager Error -5
Cannot find a license for Symbolic_Toolbox.
Make sure an INCREMENT line for Symbolic_Toolbox exists in the license file, and that the formatting of the license file is correct.
Troubleshoot this issue by visiting:
<a href="http://www.mathworks.com/support/lme/R2012a/5">http://www.mathworks.com/support/lme/R2012a/5</a>
Diagnostic Information:
Feature: Symbolic_Toolbox
License path: 13501@10.206.97.41:13501@10.10.207.33:/tmp/matlabpref/.matlab/R2012a_licenses:/opt/mlsedu/matlab/R2012a/licenses/license.dat:/opt/mlsedu/matlab/R2012a/licenses
Licensing error: -5,0.
2
Fail
 
%%
x = 1;
y_correct = 2;
assert(isequal(pow2_sumofdigits(x),y_correct))
Error: License checkout failed.
License Manager Error -5
Cannot find a license for Symbolic_Toolbox.
Make sure an INCREMENT line for Symbolic_Toolbox exists in the license file, and that the formatting of the license file is correct.
Troubleshoot this issue by visiting:
<a href="http://www.mathworks.com/support/lme/R2012a/5">http://www.mathworks.com/support/lme/R2012a/5</a>
Diagnostic Information:
Feature: Symbolic_Toolbox
License path: 13501@10.206.97.41:13501@10.10.207.33:/tmp/matlabpref/.matlab/R2012a_licenses:/opt/mlsedu/matlab/R2012a/licenses/license.dat:/opt/mlsedu/matlab/R2012a/licenses
Licensing error: -5,0.
3
Fail
 
%%
x = 15;
y_correct = 26;
assert(isequal(pow2_sumofdigits(x),y_correct))
Error: License checkout failed.
License Manager Error -5
Cannot find a license for Symbolic_Toolbox.
Make sure an INCREMENT line for Symbolic_Toolbox exists in the license file, and that the formatting of the license file is correct.
Troubleshoot this issue by visiting:
<a href="http://www.mathworks.com/support/lme/R2012a/5">http://www.mathworks.com/support/lme/R2012a/5</a>
Diagnostic Information:
Feature: Symbolic_Toolbox
License path: 13501@10.206.97.41:13501@10.10.207.33:/tmp/matlabpref/.matlab/R2012a_licenses:/opt/mlsedu/matlab/R2012a/licenses/license.dat:/opt/mlsedu/matlab/R2012a/licenses
Licensing error: -5,0.
4
Fail
 
%%
x = 345;
y_correct = 521;
assert(isequal(pow2_sumofdigits(x),y_correct))
Error: License checkout failed.
License Manager Error -5
Cannot find a license for Symbolic_Toolbox.
Make sure an INCREMENT line for Symbolic_Toolbox exists in the license file, and that the formatting of the license file is correct.
Troubleshoot this issue by visiting:
<a href="http://www.mathworks.com/support/lme/R2012a/5">http://www.mathworks.com/support/lme/R2012a/5</a>
Diagnostic Information:
Feature: Symbolic_Toolbox
License path: 13501@10.206.97.41:13501@10.10.207.33:/tmp/matlabpref/.matlab/R2012a_licenses:/opt/mlsedu/matlab/R2012a/licenses/license.dat:/opt/mlsedu/matlab/R2012a/licenses
Licensing error: -5,0.
5
Fail
 
%%
x = 999;
y_correct = 1367;
assert(isequal(pow2_sumofdigits(x),y_correct))
Error: License checkout failed.
License Manager Error -5
Cannot find a license for Symbolic_Toolbox.
Make sure an INCREMENT line for Symbolic_Toolbox exists in the license file, and that the formatting of the license file is correct.
Troubleshoot this issue by visiting:
<a href="http://www.mathworks.com/support/lme/R2012a/5">http://www.mathworks.com/support/lme/R2012a/5</a>
Diagnostic Information:
Feature: Symbolic_Toolbox
License path: 13501@10.206.97.41:13501@10.10.207.33:/tmp/matlabpref/.matlab/R2012a_licenses:/opt/mlsedu/matlab/R2012a/licenses/license.dat:/opt/mlsedu/matlab/R2012a/licenses
Licensing error: -5,0.
6
Fail
 
%%
x = 2000;
y_correct = 2704;
assert(isequal(pow2_sumofdigits(x),y_correct))
Error: License checkout failed.
License Manager Error -5
Cannot find a license for Symbolic_Toolbox.
Make sure an INCREMENT line for Symbolic_Toolbox exists in the license file, and that the formatting of the license file is correct.
Troubleshoot this issue by visiting:
<a href="http://www.mathworks.com/support/lme/R2012a/5">http://www.mathworks.com/support/lme/R2012a/5</a>
Diagnostic Information:
Feature: Symbolic_Toolbox
License path: 13501@10.206.97.41:13501@10.10.207.33:/tmp/matlabpref/.matlab/R2012a_licenses:/opt/mlsedu/matlab/R2012a/licenses/license.dat:/opt/mlsedu/matlab/R2012a/licenses
Licensing error: -5,0.