Effacer les filtres
Effacer les filtres

Substitution after differentiation (easy)?

3 vues (au cours des 30 derniers jours)
Mark
Mark le 4 Juin 2012
I am trying to substitute the variable x after differentiating y with respect to x. Any ideas on the final step?
>> syms x;
>> y=5*x^2+6*x-3;
>> y1=diff(y,x);
after this I cannot use
>> x=3;
>> y1
because this just gives me y1 in terms of x

Réponse acceptée

Walter Roberson
Walter Roberson le 4 Juin 2012
subs(y1)
Caution: the result in this case would be a symbolic number; use double() on the result if you need a floating point number that MATLAB itself can compute with.

Plus de réponses (0)

Catégories

En savoir plus sur Symbolic Math Toolbox 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!

Translated by