フィルターのクリア

Hi, anybody can help me to check for question b whether my answer is correct or not? Thanks.

2 ビュー (過去 30 日間)
Erwin Koman
Erwin Koman 2015 年 7 月 12 日
回答済み: Image Analyst 2015 年 7 月 12 日
Here is my code:
t = [0:19];
y = [6,13,23,33,54,83,118,156,210,282,...
350,440,557,685,815,990,1170,1350,1575,1830];
length (y)
Yy=-316.66;
d=y-Yy;
figure(2), bar(t,d)
r2=1-sum(d.^2)/sum((y-mean(y)).^2)

回答 (2 件)

Image Analyst
Image Analyst 2015 年 7 月 12 日
My demo on polyfit is attached. It fits a line and a cubic. Adapt as needed for your problem.

Image Analyst
Image Analyst 2015 年 7 月 12 日
For example:
coefficients = polyfit(t, y, 2);
fprintf('The equation is y = %f*t^2 + %f*t + %f\n',...
coefficients(1), coefficients(2), coefficients(3));
yfitted = polyval(coefficients, t);
sumOfResiduals = sum(............. you finish it.

カテゴリ

Help Center および File ExchangeMathematics and Optimization についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by