필터 지우기
필터 지우기

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

조회 수: 5 (최근 30일)
farzad
farzad 2019년 7월 6일
댓글: dpb 2019년 7월 7일
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
farzad
farzad 2019년 7월 6일
Ah sorry I didn't clarify I did not use exactly the same formulation every time That was only an example
dpb
dpb 2019년 7월 6일
Well, again, all we see is what you post...
So, is the Q? closed? Or is there still some issue?

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2019년 7월 6일
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.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Performance and Memory에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by