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 262048

Submitted on 17 Jun 2013 by Richard Zapor

Correct

14Size
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
 
%%
x = 10;
y=10;
y_correct =1000000;
assert(isequal(Power_THE_Product(x,y),y_correct))
ans =
     1000000
2
Pass
 
%%
x = 2;
y=3;
y_correct =216;
assert(isequal(Power_THE_Product(x,y),y_correct))
ans =
   216
3
Pass
 
%%
x = 20;
y=30;
y_correct =216000000;
assert(isequal(Power_THE_Product(x,y),y_correct))
ans =
   216000000
4
Pass
 
%%
x = 12;
y=21;
y_correct = 16003008;
assert(isequal(Power_THE_Product(x,y),y_correct))
ans =
    16003008
5
Pass
 
%%
x = 1:10;
y=1:10;
y_correct =[1 64 729  4096 15625 46656  117649 262144 531441 1000000];
assert(isequal(Power_THE_Product(x,y),y_correct))
ans =
  Columns 1 through 8
           1          64         729        4096       15625       46656      117649      262144
  Columns 9 through 10
      531441     1000000
6
Pass
 
%%
x =6:9;
y=9:12;
y_correct =[ 157464      343000      681472     1259712];
assert(isequal(Power_THE_Product(x,y),y_correct))
ans =
      157464      343000      681472     1259712