Substitution after differentiation (easy)?

2 次查看(过去 30 天)
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

采纳的回答

Walter Roberson
Walter Roberson 2012-6-4
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Symbolic Math Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by