4th degree question ploting

9 ビュー (過去 30 日間)
AHMED AKBAS
AHMED AKBAS 2020 年 11 月 26 日
コメント済み: John D'Errico 2020 年 11 月 29 日
Ctg =[0.322;0.122;0.084;0.053;0.031;0.01];
t =[0 20 40 60 80 100];
% 4th degree Equation
R = 1.914e-08*t4 -4.753e-06*t3 + 0.0004167*t2 – 0.01639*t+ 0.3213
How can I plot it to be like the attached image? please anyony
  1 件のコメント
John D'Errico
John D'Errico 2020 年 11 月 26 日
What have you tried? You should realize you will raise t to the 4th power as t.^4.

サインインしてコメントする。

採用された回答

Image Analyst
Image Analyst 2020 年 11 月 26 日
Try this:
Ctg =[0.322; 0.122; 0.084; 0.053; 0.031; 0.01];
t =[0; 20; 40; 60; 80; 100];
plot(t, Ctg, 'ko', 'LineWidth', 2, 'MarkerSize', 15);
hold on;
% Estimate the coefficients for a 4th order polynomial.
coefficients = polyfit(t, Ctg, 4)
% Make a new x
t = linspace(min(t), max(t), 1000);
% 4th degree Equation
R = coefficients(1)*t.^4 + coefficients(2)*t.^3 + coefficients(3)*t.^2 + coefficients(4)*t+ coefficients(5);
plot(t, R, 'b-', 'LineWidth', 2);
grid on;

その他の回答 (1 件)

AHMED AKBAS
AHMED AKBAS 2020 年 11 月 29 日
Thanks a lot, this is what Im looking for
  1 件のコメント
John D'Errico
John D'Errico 2020 年 11 月 29 日
Please learn to use comments.

サインインしてコメントする。

タグ

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by