Cody

Solution 1935910

Submitted on 14 Sep 2019
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status 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));

Undefined function or variable 'y'. Error in reverseArguments (line 2) g = f(y,x); Error in Test1 (line 2) g = reverseArguments(f);

2   Fail
f = @(x,y) x.^y; g = reverseArguments(f); assert(isequal(g(2,3), 9));

Undefined function or variable 'y'. Error in reverseArguments (line 2) g = f(y,x); Error in Test2 (line 2) g = reverseArguments(f);

3   Fail
f = @(A,theta) A*sin(theta); g = reverseArguments(f); assert(isequal(g(4,10), 10*sin(4)));

Undefined function or variable 'y'. Error in reverseArguments (line 2) g = f(y,x); Error in Test3 (line 2) g = reverseArguments(f);