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

Solution 135317

Submitted on 5 Sep 2012 by Binbin Qi

Correct

13Size
Leading solution size is 13.
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
Pass
 
%%
k = 2;
y_correct = 21;
assert(isequal(your_fcn_name(k),y_correct))

                    
2
Pass
 
%%
k = 6;
y_correct = 462;
assert(isequal(your_fcn_name(k),y_correct))

                    
3
Pass
 
%%
k = 20;
y_correct = 53130;
assert(isequal(your_fcn_name(k),y_correct))

                    
4
Pass
 
%%
k = 3;
y_correct = 56;
assert(isequal(your_fcn_name(k),y_correct))

                    
5
Pass
 
%%
k = 5;
y_correct = 252;
assert(isequal(your_fcn_name(k),y_correct))