matlab中用legend出的图例和所出图像的颜色不一样
以下是我的代码,求解决x1=[012345678910];y1=[22.359522.633622.904123.17123.434723.695123.952424.2...
以下是我的代码,求解决
x1=[0 1 2 3 4 5 6 7 8 9 10];
y1=[22.3595 22.6336 22.9041 23.171 23.4347 23.6951 23.9524 24.2066 24.458 24.7065 24.9523];
f1=polyfit(x1,y1,3);
x0=0:1:10;
y0=polyval(f1,x0);
x2=[0 1 2 3 4 5 6 7 8 9 10];
y2=[61.5313 61.9057 62.2777 62.6473 63.0146 63.3797 63.7425 64.103 64.4615 64.8178 65.172];
f2=polyfit(x2,y2,4);
f2=polyfit(x2,y2,4);
x3=0:1:10;
y3=polyval(f2,x3);
plot(x1,y1,'g',x0,y0,x2,y2,'b');
legend('\Omega_1','\Omega_2')
xlabel('轴向拉力');
ylabel(' \Omega');
grid on; 展开
x1=[0 1 2 3 4 5 6 7 8 9 10];
y1=[22.3595 22.6336 22.9041 23.171 23.4347 23.6951 23.9524 24.2066 24.458 24.7065 24.9523];
f1=polyfit(x1,y1,3);
x0=0:1:10;
y0=polyval(f1,x0);
x2=[0 1 2 3 4 5 6 7 8 9 10];
y2=[61.5313 61.9057 62.2777 62.6473 63.0146 63.3797 63.7425 64.103 64.4615 64.8178 65.172];
f2=polyfit(x2,y2,4);
f2=polyfit(x2,y2,4);
x3=0:1:10;
y3=polyval(f2,x3);
plot(x1,y1,'g',x0,y0,x2,y2,'b');
legend('\Omega_1','\Omega_2')
xlabel('轴向拉力');
ylabel(' \Omega');
grid on; 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询