フィルターのクリア

How to draw a plot by coefficents?

1 回表示 (過去 30 日間)
Evgheny
Evgheny 2011 年 4 月 11 日
I have 5 coefficents: for example: a = [2 3 4 5 6]
And I want to draw a plot a1 + a2*t + a3*t^2 + a4*sin(t) + a5*cos(t)
how to do this?

採用された回答

Walter Roberson
Walter Roberson 2011 年 4 月 11 日
If t is already defined as a numeric vector, then:
y = a(1) + a(2)*t + a(3)*t.^2 + a(4)*sin(t) + a(5)*cos(t);
plot(t, y);
If t is a symbolic variable, I believe you could use the same y, but afterwards you would either have to subs() in actual numeric values or else you would have to use ezplot()

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by