help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drawing line segments


From: Shaun Jackman
Subject: Re: Drawing line segments
Date: Tue, 17 Jun 2008 16:06:15 -0700
User-agent: Thunderbird 2.0.0.14 (X11/20080421)

Bill Denney wrote:
Hi Shaun,

If you do

plot ([1;2;nan;4;5], [1;2;nan;4;5])

you get broken lines where the nan values are. For your problem, you could do something like (assuming that data is your 4 column matrix):
x = reshape ([data(:,1:2) nan(rows(data),1)]', [], 1);
y = reshape ([data(:,3:4) nan(rows(data),1)]', [], 1);
plot (x,y)

Have a good day,

Bill

Worked like a charm! Thanks, Bill.

Cheers,
Shaun


reply via email to

[Prev in Thread] Current Thread [Next in Thread]