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:
Using Fsolve in A Function

Subject: Using Fsolve in A Function

From: Edward Lopez

Date: 6 Jun, 2014 20:35:13

Message: 1 of 3

Hello,

I was wondering if it was possible to use fsolve in a function. I understand how to call it in a script, but I cannot seem to use it while it is in a function. Is it possible to do that?

I am currently using this format while using fsolve in a script:
t0 = [10;10];
[t,fval] = fsolve(@solver, t0);

Thanks,
Edward Lopez

Subject: Using Fsolve in A Function

From: John D'Errico

Date: 6 Jun, 2014 23:18:08

Message: 2 of 3

"Edward Lopez" wrote in message <lmt8m1$3n$1@newscl01ah.mathworks.com>...
> Hello,
>
> I was wondering if it was possible to use fsolve in a function. I understand how to call it in a script, but I cannot seem to use it while it is in a function. Is it possible to do that?
>
> I am currently using this format while using fsolve in a script:
> t0 = [10;10];
> [t,fval] = fsolve(@solver, t0);
>
> Thanks,
> Edward Lopez

Of course it is possible. You do it exactly as you would call
it any other way. Perhaps you can show what you tried.

John

Subject: Using Fsolve in A Function

From: Edward Lopez

Date: 9 Jun, 2014 14:46:09

Message: 3 of 3

Thank you, I was able to simply call it, as if it was in a script. I don't know why I did not thinking about that before. Thanks!

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