求用MATLAB画出下面的图截图给我,急.x=0:10y=[1 1.5 2.6 3.5 4.8 2.5 5.5 4.6 7 9.2 4.7]p1=polyfit(x,y,1)y1=polyval(p1,x)p6=polyfit(x,y,6)xx=0:0.1:10y2=polyval(p6,xx)plot(x,y1,xx,y2,'r',x,y,'x')gtext('1次拟合')gtext('6次拟合')x=0:0.5:10
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/15 04:03:57
求用MATLAB画出下面的图截图给我,急.x=0:10y=[1 1.5 2.6 3.5 4.8 2.5 5.5 4.6 7 9.2 4.7]p1=polyfit(x,y,1)y1=polyval(p1,x)p6=polyfit(x,y,6)xx=0:0.1:10y2=polyval(p6,xx)plot(x,y1,xx,y2,'r',x,y,'x')gtext('1次拟合')gtext('6次拟合')x=0:0.5:10
求用MATLAB画出下面的图截图给我,急.
x=0:10
y=[1 1.5 2.6 3.5 4.8 2.5 5.5 4.6 7 9.2 4.7]
p1=polyfit(x,y,1)
y1=polyval(p1,x)
p6=polyfit(x,y,6)
xx=0:0.1:10
y2=polyval(p6,xx)
plot(x,y1,xx,y2,'r',x,y,'x')
gtext('1次拟合')
gtext('6次拟合')
x=0:0.5:10;
y=0:0.5:10;
f=(cos(x))'*sin(y);
subplot(2,2,1);surf(x,y,f)
subplot(2,2,2);mesh(x,y,f)
subplot(2,2,3);waterfall(x,y,f)
subplot(2,2,4);contour(x,y,f)
求用MATLAB画出下面的图截图给我,急.x=0:10y=[1 1.5 2.6 3.5 4.8 2.5 5.5 4.6 7 9.2 4.7]p1=polyfit(x,y,1)y1=polyval(p1,x)p6=polyfit(x,y,6)xx=0:0.1:10y2=polyval(p6,xx)plot(x,y1,xx,y2,'r',x,y,'x')gtext('1次拟合')gtext('6次拟合')x=0:0.5:10