create a function that is the derivate of a f=@(t) function

10 ビュー (過去 30 日間)
DDD
DDD 2015 年 3 月 14 日
回答済み: Giorgos Papakonstantinou 2015 年 3 月 14 日
having a function
fa=@(x) x^5-0.4475*x.^4-3.1*x.^3 + 3.085*x.^2-0:962*x+ 0:0943
how to calculate
dfa=@(x) diff(fa)
so that it is still a function and i can calculate,for example:
dfa(5)

採用された回答

Giorgos Papakonstantinou
Giorgos Papakonstantinou 2015 年 3 月 14 日
Maybe this:
fa = @(x)x^5-0.4475*x.^4-3.1*x.^3+3.085*x.^2-0.962*x+0.0943
g = sym(fa);
dg = diff(g);
df = matlabFunction(dg)
df =
@(x)x.*6.17-x.^2.*9.3-x.^3.*1.79+x.^4.*5.0-9.62e-1

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by