简体   繁体   English

使用Matlab将图中的离散点连接在一起吗?

[英]Connect discrete points together in a plot using Matlab?

If I have the following figure : 如果我有下图:

在此处输入图片说明

created by the code : 由代码创建:

for t=1:length(s)  % s is a struct with over 1000 entries
    plot(t,r1,'k'); % r1 = (0,100,150,170) + 1050
    plot(t,r2,'g'); % r2 = (0,300,350,370) + 1050
    plot(t,r3,'b'); % r3 = (0,200,250,270) + 1050
    plot(t,r4,'m'); % r4 = (0,1000,1250,1500) + 1050
    plot(t,max,'r'); % max = 2000
end

Each dot is actually propagating from 1050 to their current value. 每个点实际上是从1050传播到其当前值。 But you can't see it this way and hence why I would like for a line to be drawn to connect them all. 但是您不能以这种方式看到它,因此为什么我要画一条线将它们连接起来。

How can I connect discrete points of the same line together ? 如何将同一条线的离散点连接在一起?

Does this give the result that you want? 这会给您想要的结果吗?

for t=1:length(s)  % s is a struct with over 1000 entries
    a(t,:)=r1; % r1 = (0,100,150,170) + 1050  
end
plot(a)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM