簡體   English   中英

使用Matlab將圖中的離散點連接在一起嗎?

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

如果我有下圖:

在此處輸入圖片說明

由代碼創建:

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

每個點實際上是從1050傳播到其當前值。 但是您不能以這種方式看到它,因此為什么我要畫一條線將它們連接起來。

如何將同一條線的離散點連接在一起?

這會給您想要的結果嗎?

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