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

Learn moreOpportunities for recent engineering grads.

Apply TodayCorrect

35Size

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

Test

Code Input and Output

1

Pass

%% Test the example A = 1; iterations = 4; y_correct8 = [1 3 7 15 31]; assert(isequal(your_fcn_name(A,iterations),y_correct8))

C = 1

2

Pass

%% More ietrations A = 1; iterations = 1000; C= A for i = 1:iterations C(i+1) = 2*C(i)+1; end assert(isequal(your_fcn_name(A,iterations),C))

C = 1 C = 1