Cody

Solution 264161

Submitted on 20 Jun 2013 by Jan Orwat
  • Size: 11
  • This is the leading solution.
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   Pass
%% f = @(x,y) 2*x+y; g = reverseArguments(f); assert(isequal(g(5,6), 17)); assert(isequal(g(6,5), 16));
g = @(a,b)f(b,a) g = @(a,b)f(b,a)
2   Pass
%% f = @(x,y) x.^y; g = reverseArguments(f); assert(isequal(g(2,3), 9));
g = @(a,b)f(b,a) g = @(a,b)f(b,a)
3   Pass
%% f = @(A,theta) A*sin(theta); g = reverseArguments(f); assert(isequal(g(4,10), 10*sin(4)));
g = @(a,b)f(b,a) g = @(a,b)f(b,a)