sym(1/3) bug?

3 views (last 30 days)
Andrew Dabrowski
Andrew Dabrowski on 13 Feb 2021
Commented: Adam Danz on 13 Feb 2021
But when I try running this I get
Is this a bug or am I doing something wrong?

Accepted Answer

Adam Danz
Adam Danz on 13 Feb 2021
Edited: Adam Danz on 13 Feb 2021
Check your symbolic preferences.
sympref
ans = struct with fields:
FourierParameters: [1×2 sym] HeavisideAtOrigin: [1×1 sym] AbbreviateOutput: 1 TypesetOutput: 1 FloatingPointOutput: 0 PolynomialDisplayStyle: 'default' MatrixWithSquareBrackets: 0
If the FloatingPointOutput if true change it to false
sympref('FloatingPointOutput',true);
sym(1/3)
ans = 
0.3333
sympref('FloatingPointOutput',false);
sym(1/3)
ans = 
  1 Comment
Adam Danz
Adam Danz on 13 Feb 2021
Andrew Dabrowski's answer moved here as comment
Ah thanks, that was it!

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!