matlab - Function handler -


i'm using 2 distinct functions on matlab: function1 , function2 (each written in different script).

in script of function1, have 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, have:

function otherresult = function2(do_this, do_that) m = matrix; p = do_this(m) otherresult = do_that(p) end 

i found have problem in function2, since whenever try display p (the result of function do_this defined in script1), value nan.

i can't see problem? using function handlers in incorrect way?

thanks help


Comments