Generate diagram in linear scale

1 ビュー (過去 30 日間)
Berkay
Berkay 2022 年 8 月 30 日
回答済み: Abderrahim. B 2022 年 8 月 30 日
I defined a polynomia;
P = [1 10 -13 -118 120]
I want to generate a diagram in linear scale of that polynomial in range from -100 to 100
How can I do it?

採用された回答

Abderrahim. B
Abderrahim. B 2022 年 8 月 30 日
Hi!
See these 2 methods:
P = [1 10 -13 -118 120] ;
Method 1:
figure
plot(-100:100, polyval(P, -100:100))
Method 2:
myPoly = @(p)P(1)*p.^4 + P(2)*p.^3 -P(3)*p.^2 -P(4)*p.^1 + P(5) ;
plot(-100:100, myPoly(-100:100))

その他の回答 (1 件)

Alan Stevens
Alan Stevens 2022 年 8 月 30 日
See
help polyval

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by