In order to get to know MATLAB a little bit better, I tried to run the following code which I found on a help file of MATLAB:
function F = myfun(x,c)
F = [ 2*x(1) - exp(c*x(1))
-x(1) - exp(c*x(2))
x(1) - x(2) ];
c = -1; % define parameter first
x = lsqnonlin(@(x) myfun(x,c),[1;1])
However, I get the following error :
Error using F (line 2)
Not enough input arguments.
How is this possible? The two arguments necessary ( x and c) are stated in the definition of F, right?
Hope you can help me with this ! Many thanks in advance for your replies!