Path: news.mathworks.com!not-for-mail 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$1@fred.mathworks.com> References: <i5d7in$p17$1@fred.mathworks.com> <i5ddlj$ilv$1@fred.mathworks.com> <i5dkbb$lco$1@fred.mathworks.com> <i5dkoh$hj1$1@fred.mathworks.com> <i5dtfr$10r$1@fred.mathworks.com> <i5edc0$euq$1@fred.mathworks.com> <i72fqr$gip$1@fred.mathworks.com> <i72iu8$153$1@fred.mathworks.com> <i73ko5$mv0$1@fred.mathworks.com> <i73m5c$ktu$1@fred.mathworks.com> <i73o4s$nmb$1@fred.mathworks.com> <i74djn$4gb$1@fred.mathworks.com> <i751gm$b82$1@fred.mathworks.com> <i75uo8$nr1$1@fred.mathworks.com> <i84vcl$c05$1@fred.mathworks.com> <i85mjk$eia$1@fred.mathworks.com> Reply-To: <HIDDEN> NNTP-Posting-Host: webapp-03-blr.mathworks.com Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: fred.mathworks.com 1285973824 14623 172.30.248.38 (1 Oct 2010 22:57:04 GMT) X-Complaints-To: news@mathworks.com NNTP-Posting-Date: Fri, 1 Oct 2010 22:57:04 +0000 (UTC) X-Newsreader: MATLAB Central Newsreader 2386204 Xref: news.mathworks.com comp.soft-sys.matlab:675171 "Marc " <marc.schreier@uop.com> wrote in message <i85mjk$eia$1@fred.mathworks.com>... > "Prasad M. Rao" <XLR8RPM@Gmail.com> wrote in message <i84vcl$c05$1@fred.mathworks.com>... > > 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)); plot(X(n),Y(n),col(m)) hold on end Ross