MATLAB not giving me the desired answer format

2 views (last 30 days)
I have never had this issue with MATLAB until now. my results are being displayed as follows:
>> syms x
>> f = inline('(2/25)*x^2','x')
f =
Inline function:
f(x) = (2/25)*x^2
>> diff(f(x),x)
ans =
0.1600000000 x
And the format I want is as such:
My MATLAB was dsplaying like the example in the picture before yesterday. Do not understand what happened. Thanks in advance.
  2 Comments
Rik
Rik on 7 May 2021
Why are you still using inline functions? And what exactly is your question? Do you want to know how to evaluate that expression to a value?
Or is it something to do with the format function?
Stanley Santos
Stanley Santos on 7 May 2021
My question is why is MATLAB displaying my results as shown in the first example, instead of the second example.

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 7 May 2021
sympref('FloatingPointOutput', false);

Categories

Find more on Function Creation in Help Center and File Exchange

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!