Solving nonlinear system of equations without defining a function

How can I solve a nonlinear system of equations by fsolve without defining a "function.m"?

Answers (1)

For simple problems, you could use a function handle:
F=@(x)(x.^2-1);
x0=0;
[x,fval] = fsolve(F,x0);
Best wishes
Torsten.

Categories

Asked:

on 12 Nov 2014

Answered:

on 12 Nov 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!