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 304574

Submitted on 15 Aug 2013 by Claudio Gelmi

Correct

40Size
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.

This solution is outdated. To rescore this solution, log in.

Test Suite

Test
Code Input and Output
1
Pass
 
%%
aVec = [3.14 15 8 26];
bVec = [2.71;8;28;182];
ref = sqrt((aVec').^2+bVec.^2)
user = MyFunc();
assert(isequal(user,ref))
ref =
    4.1477
   17.0000
   29.1204
  183.8478
ans =
    4.1477
   17.0000
   29.1204
  183.8478
2
Pass
 
%%
aRef = [3.14 15 8 26];
[yVec aVec] = MyFunc();
assert(isequal(aRef,aVec))
ans =
    4.1477
   17.0000
   29.1204
  183.8478
3
Pass
 
%%
bRef = [2.71;8;28;182];
[yVec aVec bVec] = MyFunc();
assert(isequal(bRef,bVec))
ans =
    4.1477
   17.0000
   29.1204
  183.8478