What is it called when I specify a vector output of solutions from, say, fsolve?

조회 수: 2 (최근 30일)
Noob
Noob 2020년 10월 2일
댓글: Rik 2020년 10월 2일
Hi,
I have a simple question -- just a matter of lingo, I think:
The fsolve algorithm gives all these outputs when it arrives at a solution:
[ x, fval, exit_flag, output, Jacobian ]
If I only write code such as
x = fsolve(f, x_guess)
then I get simply the solution from fsolve.
But if I write
[x, fval] = fsolve(f, x_guess)
then I get both the solution as well as the function evaluation at that solution.
And ditto for exit_flag, output, Jacobian.
What is this process called, when I enlarge the vector output to specify what I want the code to bring back?
Sorry, I know it's a very basic question, but I just want to use the correct lingo.
Thanks,

채택된 답변

Rik
Rik 2020년 10월 2일
Those are called output arguments. Sometimes functions will use the nargout function to determine which calculations should be performed.
  댓글 수: 2
Noob
Noob 2020년 10월 2일
편집: Noob 2020년 10월 2일
Ah, ok - so it's just me specifying the output arguments. Thanks for the quick answer, Rik!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by