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!