From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Plotting a graph of three variables
Date: Fri, 1 Oct 2010 22:57:04 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 32
Message-ID: <i85p00$e8v$>
References: <i5d7in$p17$> <i5ddlj$ilv$> <i5dkbb$lco$> <i5dkoh$hj1$> <i5dtfr$10r$> <i5edc0$euq$> <i72fqr$gip$> <i72iu8$153$> <i73ko5$mv0$> <i73m5c$ktu$> <i73o4s$nmb$> <i74djn$4gb$> <i751gm$b82$> <i75uo8$nr1$> <i84vcl$c05$> <i85mjk$eia$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1285973824 14623 (1 Oct 2010 22:57:04 GMT)
NNTP-Posting-Date: Fri, 1 Oct 2010 22:57:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2386204
Xref: comp.soft-sys.matlab:675171

"Marc " <> wrote in message <i85mjk$eia$>...
> "Prasad M. Rao" <> wrote in message <i84vcl$c05$>...
> > Hey Ross I hope its not too late.
> > 
> > I've finally got the logic required to plot my graphs.
> > I hope you help me out now.
> > What I'm dealing with is raw data with multiple channels, but the best part is that these channels are all recorded at the same time that means the value for X at say reading no. 12990 corresponds exactly to reading no. 12990 for Y and similarly for Z too.
> > So what I need to do is to...
> > FIRST, filter out data corresponding to Z equal to the value required say maybe 1.25, so since the data is continuous I filter out data for the range of Z between 1.2 & 1.3.
> > So now I have the data for X & Y for this Z in the range (1.2, 1.3).
> > SECOND, now I just plot the X & Y at a different colour for Z=1.25.
> > THIRD, using the hold command I do so for as many Z values that I want thus filtering out the data as I go for each individual graph.
> > I'm not too good with the program syntax but I'm guessing I need the for loop and the hold command along with some other commands.
> > Hope you help me out with the codes, I'm sure this is it.
> > Please, fingers crossed here.
> > Thanks.

A variation on my previous post ...

Zlist=[1.2 1.3 1.4 ];

and you also have your X, Y, Z

col='rgbymck'; %a list of colours (longer than it needs to be ...)

for m=1:numel(Zlist)-1
 n=find(Z>Zlist(m) & Z<=Zlist(m+1));
 hold on