Differentiating a function and finding critical points

8 ビュー (過去 30 日間)
Will
Will 2014 年 2 月 28 日
編集済み: Mischa Kim 2014 年 2 月 28 日
I have been set a problem and managed to complete the first part which was to plot the function:
y= t^6-4*t^4-2*t^3+3*t^2+2*t
This was done in the Editor as a script: %script file to plot (y =f(t)= t^6-4*t^4-2*t^3+3*t^2+2*t) %interval [-3/2:5/2] t =[-3/2:0.01:5/2]; y=t.^6-4*t.^4-2*t.^3+3*t.^2+2.*t; plot (t,y)
But now I have to differentiate this function to find where f'(t) = 0...
In the command window, I typed diff(y), which gives a list of values. However, I am not sure how to use fzero to find the critical points.

採用された回答

Mischa Kim
Mischa Kim 2014 年 2 月 28 日
編集済み: Mischa Kim 2014 年 2 月 28 日
Will, you could work symbolically to get the job done:
syms y t
y = t^6 - 4*t^4 - 2*t^3 + 3*t^2 + 2*t;
dy = diff(y,t)
dy =
6*t^5 - 16*t^3 - 6*t^2 + 6*t + 2
rootsdy = double(solve(dy == 0))
rootsdy =
-1.000000000000000
-1.000000000000000
1.684694738462017
0.629578614136595
-0.314273352598613
ezplot(y,[-1 2])
grid

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCalculus についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by