Effacer les filtres
Effacer les filtres

Do I need to reset Fsolve Parameters if I use Fsolve twice in my code ?

5 vues (au cours des 30 derniers jours)
farzad
farzad le 6 Juil 2019
Commenté : dpb le 7 Juil 2019
Hi All
If I have to use Fsolve twice in my code, do I need to reset any paramter ?
[x,fval,exitflag,output] = fsolve(fun,x0initial,options);
  8 commentaires
farzad
farzad le 6 Juil 2019
Ah sorry I didn't clarify I did not use exactly the same formulation every time That was only an example
dpb
dpb le 6 Juil 2019
Well, again, all we see is what you post...
So, is the Q? closed? Or is there still some issue?

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 6 Juil 2019
No. However if you do not change any of the parameters and the function does not involve random variables, then the second call would give the same result as the first call.
fsolve does not modify any of the input parameters.
I do sometimes see people using code such as
x = [0,10]
x = fzero(SomeFunction, x0, x);
and then get surprised when they try to use x as if it were still the vector instead of having been replaced with the specific solution.

Plus de réponses (0)

Catégories

En savoir plus sur Performance and Memory dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by