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 256811

Submitted on 6 Jun 2013 by Dan

Correct

12Size
Leading solution size is 12.
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
 
%%
a = [1 2 3]
b = [4 5 6]
y_correct = [4 13 28 27 18];
assert(isequal(your_fcn_name(a,b),y_correct))
a =
     1     2     3
b =
     4     5     6
ans =
     4    13    28    27    18
2
Pass
 
%%
a = [3 4 0]
b = [9 6 2 0 1]
y_correct = [27 54 30 8 3 4 0];
assert(isequal(your_fcn_name(a,b),y_correct))
a =
     3     4     0
b =
     9     6     2     0     1
ans =
    27    54    30     8     3     4     0