How to remove text from fsolve result

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

Answers (3)

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 Comments

I am getting same results, the message is appearing in results list
It worked for me! Thank you
Thanks, It worked for too.

Sign in to comment.

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 Comments

putting code
options = optimset('Display','off');
in fsolve does remove message in the result.
Are you passing the options to fsolve() ? Please show your current code.
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
That does not pass the options to fsolve. Look again at Paulo's answer: he provides options as the third parameter to fsolve().

Sign in to comment.

Paulo Silva
Paulo Silva on 6 Mar 2011
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 Comment

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

Sign in to comment.

Asked:

on 6 Mar 2011

Commented:

Joy
on 26 Dec 2023

Community Treasure Hunt

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

Start Hunting!