高分急求 在线等 如何用matlab 画4条直线 并且给这4条直线命名.t=[0,2,4,6,8];y1=[0,0.075,0.135,0.1875,0.255];y2=[0,0.0625,0.125,0.25,0.5];y3=[0,0.0125,0.025,0.05,0.1];y4=[0.01,0.01,0.01,0.01,0.01];让matlab 同时显示这4条直
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/25 13:29:45
高分急求 在线等 如何用matlab 画4条直线 并且给这4条直线命名.t=[0,2,4,6,8];y1=[0,0.075,0.135,0.1875,0.255];y2=[0,0.0625,0.125,0.25,0.5];y3=[0,0.0125,0.025,0.05,0.1];y4=[0.01,0.01,0.01,0.01,0.01];让matlab 同时显示这4条直
高分急求 在线等 如何用matlab 画4条直线 并且给这4条直线命名.
t=[0,2,4,6,8];
y1=[0,0.075,0.135,0.1875,0.255];
y2=[0,0.0625,0.125,0.25,0.5];
y3=[0,0.0125,0.025,0.05,0.1];
y4=[0.01,0.01,0.01,0.01,0.01];
让matlab 同时显示这4条直线,并且给这4条直线命名,如:直线1.
我一点也不会用matlab,我把下面两位人的程序拷进matlab 7.0,程序出现以下错误: To get started, select MATLAB Help or Demos from the Help menu.
The element type "name" must be terminated by the matching end-tag "".
Could not parse the file: g:\matlab\toolbox\ccslink\ccslink\info.xml
ans =
123麻烦你们好人帮到底,把这个程序自己编出来以后在matlab 7.0 运行完以后 再告诉我 谢谢了
高分急求 在线等 如何用matlab 画4条直线 并且给这4条直线命名.t=[0,2,4,6,8];y1=[0,0.075,0.135,0.1875,0.255];y2=[0,0.0625,0.125,0.25,0.5];y3=[0,0.0125,0.025,0.05,0.1];y4=[0.01,0.01,0.01,0.01,0.01];让matlab 同时显示这4条直
t=[0,2,4,6,8];
y1=[0,0.075,0.135,0.1875,0.255];
y2=[0,0.0625,0.125,0.25,0.5];
y3=[0,0.0125,0.025,0.05,0.1];
y4=[0.01,0.01,0.01,0.01,0.01];
subplot(2,2,1),plot(t,y1),title('直线1');
subplot(2,2,2),plot(t,y2),title('直线2');
subplot(2,2,3),plot(t,y3),title('直线3');
subplot(2,2,4),plot(t,y4),title('直线4');
这样可以实现
程序没有问题啊,我是运行了才发上来的.你把你的错误完整的发上来吧
我用matlab2007运行过,没有问题.7.0我以前也用过,好像不能直接输入汉字,但是应该能识别啊?你这样改一下看看:
t=[0,2,4,6,8];
y1=[0,0.075,0.135,0.1875,0.255];
y2=[0,0.0625,0.125,0.25,0.5];
y3=[0,0.0125,0.025,0.05,0.1];
y4=[0.01,0.01,0.01,0.01,0.01];
subplot(2,2,1),plot(t,y1),title('line1');
subplot(2,2,2),plot(t,y2),title('line2');
subplot(2,2,3),plot(t,y3),title('line3');
subplot(2,2,4),plot(t,y4),title('line4');
再出不来,应该就是你的软件有问题了.
t=[0,2,4,6,8];
y1=[0,0.075,0.135,0.1875,0.255];
y2=[0,0.0625,0.125,0.25,0.5];
y3=[0,0.0125,0.025,0.05,0.1];
y4=[0.01,0.01,0.01,0.01,0.01];
figure(1);
plot(t,y1,t,y2,t,y3,t,y4)<...
全部展开
t=[0,2,4,6,8];
y1=[0,0.075,0.135,0.1875,0.255];
y2=[0,0.0625,0.125,0.25,0.5];
y3=[0,0.0125,0.025,0.05,0.1];
y4=[0.01,0.01,0.01,0.01,0.01];
figure(1);
plot(t,y1,t,y2,t,y3,t,y4)
title('未拟合');
legend('直线1','直线2','直线3','直线4');
画出来的不是直线,经过最小二乘法拟合后
p1=polyfit(t, y1, 1);
z1=polyval(p1, t);
p2=polyfit(t, y2, 1);
z2=polyval(p2, t);
p3=polyfit(t, y3, 1);
z3=polyval(p3, t);
p4=polyfit(t, y4, 1);
z4=polyval(p4, t);
figure(2);
plot(t,z1,t,z2,t,z3,t,z4);
legend('直线1','直线2','直线3','直线4');
收起