Best Fit Line for Parabola
93 ビュー (過去 30 日間)
古いコメントを表示
I am trying to make a best fit line for a negative parabola, but when I use polyfit(x,y,2) and plot it I get the following image. Any tips?
1 件のコメント
回答 (1 件)
Star Strider
2022 年 9 月 22 日
Try something like this —
x = [0; 0.019; 0.036];
y = [0.015; 0.25; 0.05];
p = polyfit(x, y, 2)
xv = linspace(min(x), max(x));
yv = polyval(p,xv);
figure
plot(x, y, 'o')
hold on
plot(xv, yv, '-r')
hold off
xlabel('x')
ylabel('y')
.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Interpolation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!