Wrong behavior of symbolic number creation in R2022a

3 visualizaciones (últimos 30 días)
SHC
SHC el 19 de Jul. de 2022
Respondida: Steven Lord el 19 de Jul. de 2022
In R2022a, when I tried to create a symbolic number, I got this output:
>> sym(1/3)
ans =
0.3333
>> sym(1/3)
1/3
Below is the version I am using:
Symbolic Math Toolbox Version 9.1 (R2022a)

Respuesta aceptada

Steven Lord
Steven Lord el 19 de Jul. de 2022
Did you change your symbolic preferences without realizing it?
sympref('FloatingPointOutput',true);
x = sym(1/3)
x = 
0.3333
sympref('FloatingPointOutput', false);
y = sym(1/3)
y = 
sympref('FloatingPointOutput', 'default');
z = sym(1/3)
z = 
whatIsFPOSetTo = sympref('FloatingPointOutput') % Default is false
whatIsFPOSetTo = logical
0

Más respuestas (0)

Categorías

Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by