added a test case to make it a wee bit harder
function y = pow2_sumofdigits(x)
number = sym(2^x);
n = char(number);
y = 0;
for i = 1:length(n)
y = y + str2double(n(i));
this code gives exact results on my mechine but not work in cody show error
Error: License checkout failed.
License Manager Error -5
Cannot find a license for Symbolic_Toolbox.
Troubleshoot this issue by visiting:
License path: firstname.lastname@example.org:email@example.com:/tmp/matlabpref/.matlab/R2013a_licenses:/opt/mlsedu/matlab/R2013a/licenses/license.dat:/opt/mlsedu/matlab/R2013a/licenses
Licensing error: -5,0.
please help me ...........
Symbolic_Toolbox can't run on Cody.
Omit columns averages from a matrix
Whether the input is vector?
Remove white space from the string
Symmetry of vector
Number of 1s in the Binary Representation of a Number
Generalized N-Cards Problem
Pull the variable y_correct from the Caller's Workspace
Find the treasures in MATLAB Central and discover how the community can help you!
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office