Cannot pass function handle as an argument of a function
问题 I'm new to Matlab and I'm trying to write custom function in matlab that would take function handle as one of its arguments. I'm getting this error all the time: Error using subsindex Function 'subsindex' is not defined for values of class 'function_handle'. Trying to debug I performed following test: I run command x = fminbnd(@humps, 0.3, 1) . I proceeded as expected - I got result x = 0.6370 . So I created custom function called train and I copied ALL the code of function fminbnd to the