This commit is contained in:
2025-11-17 11:16:02 +08:00
Unverified
parent 4bd2d87fc4
commit 1b3b07a7f6
35 changed files with 454 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
x=1:10;
y=[4.9,3.3,4.2,4.2,5.7,6.5,7.7,9.4,14.7,19.0];
a=polyfit(x,y,2);
b=polyfit(x,y,3);
c=polyfit(x,y,4);
xx=1:0.1:10;
yy1=polyval(a,xx);
yy2=polyval(b,xx);
yy3=polyval(c,xx);
plot(x,y,'*b')
hold on
plot(xx,yy1,'-r',xx,yy2,'-g',xx,yy3,'-y')
title('2,3,4线')
xlabel('x')
ylabel('y')
legend('y','yy1','yy2','yy3')