Discover MakerZone

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

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!

Solution 124542

Submitted on 7 Aug 2012 by Khaled Hamed

Correct

13Size
This is the leading solution.
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))
ans =
    21

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

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

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

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