i have problem in uses of inline or syms ordes
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
xosro
le 16 Mai 2015
Commenté : Walter Roberson
le 16 Mai 2015
i want have a variable like x that define on x ,f(x) function,then program does math operators on f(x) and compute the result of this operators for specified x,
for example in During the a code i want define x with syms order and obtain f=x^2+x+1, then compute f(1)^2
0 commentaires
Réponse acceptée
Walter Roberson
le 16 Mai 2015
syms x
f = x^2+x+1;
subs(f^2,x,1)
3 commentaires
Walter Roberson
le 16 Mai 2015
The result of a computation with symbolic values is a symbolic value. If you want the closest floating point equivalent, double() the symbolic value. For example,
double(subs(f^2,x,1))
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Function Creation dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!