Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
how to use fsolve

Subject: how to use fsolve

From: Pappu Kumar

Date: 22 Sep, 2010 19:20:20

Message: 1 of 2

i tried to use fsolve for solving the set of two non linear equations as given in the product help of the matlab but i got an error "??? Input argument "x" is undefined.

Error in ==> myfun at 2
F = [2*x(1) - x(2) - exp(-x(1));
 "
How to use fsolve to solve set of two simple non linear equations..

Subject: how to use fsolve

From: Sean

Date: 22 Sep, 2010 20:27:24

Message: 2 of 2

"Pappu Kumar" <nawagarh@yahoo.co.in> wrote in message <i7dktk$24l$1@fred.mathworks.com>...
> i tried to use fsolve for solving the set of two non linear equations as given in the product help of the matlab but i got an error "??? Input argument "x" is undefined.
>
> Error in ==> myfun at 2
> F = [2*x(1) - x(2) - exp(-x(1));
> "
> How to use fsolve to solve set of two simple non linear equations..

Apparently x isn't defined:

function out = myfun(x)
 out = [2*x(1) - x(2) - exp(-x(1));
end

Perhaps you meant that?

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us