I'm using two distinct functions on matlab: function1 and function2 (each written in a different script).
In the script of function1, I have something like:
function result = function1(y,z)
result = function2(@(x)do_this(x,y,z), @(f)do_that(f,y,z))
function f = do_this(x,y,z)
f = operationOn(x,y,z)
end
function d = do_that(f,x,z)
d = operationOn(f,y,z)
end
end
and in function2's script, I have:
function otherResult = function2(do_this, do_that)
m = matrix;
p = do_this(m)
otherResult = do_that(p)
end
I found that I have a problem in function2, since whenever I try to display p (the result of the function do_this defined in the script1), the value I get is NaN.
I can't see where is the problem? Am I using function handlers in an incorrect way?
Thanks for your help