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
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
Fail
 
%%
f = @(x,y) 2*x+y;
g = reverseArguments(f);
assert(isequal(g(5,6), 17));
assert(isequal(g(6,5), 16));
Error: You may not use the command(s) str2func in your code
2
Fail
 
%%
f = @(x,y) x.^y;
g = reverseArguments(f);
assert(isequal(g(2,3), 9));
Error: You may not use the command(s) str2func in your code
3
Fail
 
%%
f = @(A,theta) A*sin(theta);
g = reverseArguments(f);
assert(isequal(g(4,10), 10*sin(4)));
Error: You may not use the command(s) str2func in your code