I have written a number of extensions to the Matlab struct type, which I have stored in a directory called @struct. One of these methods is declared as follows:
function D=moddata(D,Field,Fn,new)...
in which Fn is a function handle.
However, I am seeing the following behavior:
K>> which moddataC:\Users\...\util\@struct\moddata.m % struct methodK>> isa(S,'struct')ans = 1K>> moddata(S,'Path',@(x)regexprep(x,my_RE,'$1'),'CIPath')Error using keyboardUndefined function 'moddata' for input arguments of type 'function_handle'. K>>
Other methods in the @struct folder are being accessed just fine.
Why is Matlab not finding my method? It seems to be unduly focusing on the function_handle instead of the struct argument.
Thanks in advance.
Best Answer