Wrong behavior of symbolic number creation in R2022a
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
SHC
am 19 Jul. 2022
Beantwortet: Steven Lord
am 19 Jul. 2022
In R2022a, when I tried to create a symbolic number, I got this output:
>> sym(1/3)
ans =
0.3333
The document ( https://www.mathworks.com/help/symbolic/create-symbolic-numbers-variables-and-expressions.html ) says it works as below:
>> sym(1/3)
1/3
Below is the version I am using:
Symbolic Math Toolbox Version 9.1 (R2022a)
0 Kommentare
Akzeptierte Antwort
Steven Lord
am 19 Jul. 2022
Did you change your symbolic preferences without realizing it?
sympref('FloatingPointOutput',true);
x = sym(1/3)
sympref('FloatingPointOutput', false);
y = sym(1/3)
sympref('FloatingPointOutput', 'default');
z = sym(1/3)
whatIsFPOSetTo = sympref('FloatingPointOutput') % Default is false
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Assumptions finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!