Error fsolve
Show older comments
I write a file that computes F, the values of the equations at x.
function F = myfun(x)
F = [2*x(1) - x(2) - exp(-x(1));
-x(1) + 2*x(2) - exp(-x(2))];
Save this function file as myfun.m somewhere on your MATLAB path. Next, set up the initial point and options and call fsolve:
x0 = [-5; -5];
options=optimset('Display','iter');
[x,fval] = fsolve(@myfun,x0,options)
Then I get a mistake
??? Attempt to execute SCRIPT fsolve as a function:
\fsolve.m
Error in ==> fsolve at 3
[x,fval] = fsolve(@myfun,x0,options)
What is wrong?
Thanks in advance.
Accepted Answer
More Answers (0)
Categories
Find more on Systems of Nonlinear Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!