Problem 651. Functional inputs
Solution Stats
Problem Comments
-
2 Comments
Alex Feinman
on 2 May 2012
I'd like to include the test case listed below, but I'm stumped as to why it doesn't work:
%%
x1 = [ 1 2 3 ]
x2 = [ 10 20 ]
y_correct = [9 19; 8 18; 7 17]
y_actual = gridit(@minus, x1, x2);
assert(isequal(y_actual, y_correct));
Venu Lolla
on 2 May 2012
Alex, I believe it is because the 'minus' function requires two input arguments. The test cases and the example use functions that accept a single input argument. Hope that helps.
Solution Comments
Show commentsProblem Recent Solvers17
Suggested Problems
-
How to find the position of an element in a vector without using the find function
2632 Solvers
-
683 Solvers
-
6555 Solvers
-
Detect a number and replace with two NaN's
188 Solvers
-
349 Solvers
More from this Author3
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!