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));
ans =
function_handle with value:
@(x,y)f(y,x)
|
2 | Pass |
f = @(x,y) x.^y;
g = reverseArguments(f);
assert(isequal(g(2,3), 9));
ans =
function_handle with value:
@(x,y)f(y,x)
|
3 | Pass |
f = @(A,theta) A*sin(theta);
g = reverseArguments(f);
assert(isequal(g(4,10), 10*sin(4)));
ans =
function_handle with value:
@(x,y)f(y,x)
|
9868 Solvers
Vectorizing, too easy or too hard?
128 Solvers
Fahrenheit to Celsius converter
358 Solvers
2981 Solvers
2455 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!