Why does the SUBS function in the Symbolic Toolbox give an output of type DOUBLE?

1 visualizzazione (ultimi 30 giorni)
When I execute the SUBS function on a symbolic object that contains no variables, I expect the output to be identical to the input. However, the SUBS function converts it to a double-precision number:
syms A x y
A = sym(1);
class(A)
A = subs(A,x,y);
class(A)

Risposta accettata

MathWorks Support Team
MathWorks Support Team il 27 Giu 2009
This is a designed feature of the SUBS function. To ensure that your output remains a symbolic object, use the SYM function:
syms A x y
A = sym(1);
class(A)
A = sym(subs(A,x,y));
class(A)

Più risposte (0)

Categorie

Scopri di più su Symbolic Math Toolbox in Help Center e File Exchange

Prodotti


Release

R2007a

Community Treasure Hunt

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

Start Hunting!

Translated by