Substitution after differentiation (easy)?
3 ビュー (過去 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
0 件のコメント
採用された回答
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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Symbolic Math Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!