필터 지우기
필터 지우기

How to remove text from fsolve result

조회 수: 113 (최근 30일)
Zulhash Uddin
Zulhash Uddin 2011년 3월 6일
댓글: Joy 2023년 12월 26일
clc
clear all
f=@(x)[3*x(1)^3+x(1)^2-18; x(2)^3-5*x(2)^2+10];
x = fsolve(f,[0.001 0.001])
%RESULT as FOLLOWS
Equation solved.
fsolve completed because the vector of function values is near zero
as measured by the default value of the function tolerance, and
the problem appears regular as measured by the gradient.
<stopping criteria details>
x =
1.71252757489359 1.75564007603342

답변 (3개)

Paulo Silva
Paulo Silva 2011년 3월 6일
clc
clear
options = optimset('Display','off');
f=@(x)[3*x(1)^3+x(1)^2-18; x(2)^3-5*x(2)^2+10];
x = fsolve(f,[0.001 0.001],options)
  댓글 수: 3
Pedro Miguel Trula
Pedro Miguel Trula 2018년 2월 15일
It worked for me! Thank you
Joy
Joy 2023년 12월 26일
Thanks, It worked for too.

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


Walter Roberson
Walter Roberson 2011년 3월 6일
This is the same question (but apparently from someone else) as was asked earlier today, #2568, and is an exact duplicate of one asked a few minutes ago by the same poster as this one, #2587
  댓글 수: 4
Zulhash Uddin
Zulhash Uddin 2011년 3월 6일
clc
clear
options = optimset('Display','off');
f=@(x)[3*x(1)^3+x(1)^2-18; x(2)^3-5*x(2)^2+10];
x = fsolve(f,[0.001 0.001])
%RESULTS AS FOLLOWS:
Equation solved.
fsolve completed because the vector of function values is near zero
as measured by the default value of the function tolerance, and
the problem appears regular as measured by the gradient.
<stopping criteria details>
x =
1.7125 1.7556
Walter Roberson
Walter Roberson 2011년 3월 6일
That does not pass the options to fsolve. Look again at Paulo's answer: he provides options as the third parameter to fsolve().

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


Paulo Silva
Paulo Silva 2011년 3월 6일
Your code doesn't return any text, it just sends a message to the command line and puts the result in the variable x.
  댓글 수: 1
Zulhash Uddin
Zulhash Uddin 2011년 3월 6일
Paulo Silva,
Thank you very much for answer, however, I don't want to see this message in my result list. so how can I remove this message from my result list

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

Community Treasure Hunt

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

Start Hunting!

Translated by