When I run the following simple program to optimize a function:
function y=MyMinimize(x)y=x(1)^2+x(2)^2;z=fminsearch(@MyMinimize,[1000 1000]);
I used the following function call:
MyMinimize([1 1])
However, this did not work. I received the following error:
??? Maximum recursion limit of 500 reached. Use set(0,'RecursionLimit',N) to change the limit. Be aware that exceeding your available stack space can crash MATLAB and/or your computer.
Best Answer