matlab绘图只显示点不显示连线程序是这样的clear allclcr3 = [50:20:400];r = 900;r1 = 150;r2 = 150;r4 = 150;b1 = 200;b2 = 200;b3 = 200;b4 = 200;y1 = b1./r;y2 = b2./(r-r1)+b1./(r-r1);y3 = (b3+b2+b1)./(r-r1-r2);y4 = (b4+b3+b2+b1)./(r-r1-r2
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/21 17:49:23
matlab绘图只显示点不显示连线程序是这样的clear allclcr3 = [50:20:400];r = 900;r1 = 150;r2 = 150;r4 = 150;b1 = 200;b2 = 200;b3 = 200;b4 = 200;y1 = b1./r;y2 = b2./(r-r1)+b1./(r-r1);y3 = (b3+b2+b1)./(r-r1-r2);y4 = (b4+b3+b2+b1)./(r-r1-r2
matlab绘图只显示点不显示连线
程序是这样的
clear all
clc
r3 = [50:20:400];
r = 900;
r1 = 150;
r2 = 150;
r4 = 150;
b1 = 200;
b2 = 200;
b3 = 200;
b4 = 200;
y1 = b1./r;
y2 = b2./(r-r1)+b1./(r-r1);
y3 = (b3+b2+b1)./(r-r1-r2);
y4 = (b4+b3+b2+b1)./(r-r1-r2-r3);
plot(r3,y1,'k-<',r3,y2,'b-o',r3,y3,'r-*',r3,y4,'c-s');
xlabel('服务速率(Kbps) ','fontsize',13);
ylabel('时延界限(s) ','fontsize',13);
legend('vip','高','中','低' ,1);
set(gca,'FontSize',13);
set(gca,'xminortick','on');
set(gca,'yminortick','on');
grid on;
只有y4的点是有连线的,而且框里面的标示也不对,不知道哪里出错了,求教.
是因为其他几条线不是连续的么,怎么让他们点连起来呢?
matlab绘图只显示点不显示连线程序是这样的clear allclcr3 = [50:20:400];r = 900;r1 = 150;r2 = 150;r4 = 150;b1 = 200;b2 = 200;b3 = 200;b4 = 200;y1 = b1./r;y2 = b2./(r-r1)+b1./(r-r1);y3 = (b3+b2+b1)./(r-r1-r2);y4 = (b4+b3+b2+b1)./(r-r1-r2
你的问题不是这个,你的y1,y2和y3都是一个数值,而r3是一个数组,只有y4和r3是同大小的数组,所以默认状况只有他能画图和连线.把程序改好了再说吧!