From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Plotting a graph of three variables
Date: Sat, 2 Oct 2010 07:12:04 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 22
Message-ID: <i86m04$fbb$>
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$> <i86bbc$sqi$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1286003524 15723 (2 Oct 2010 07:12:04 GMT)
NNTP-Posting-Date: Sat, 2 Oct 2010 07:12:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2386204
Xref: comp.soft-sys.matlab:675228

"Prasad M. Rao" <> wrote in message <i86bbc$sqi$>...
> Hey Mark your code worked great, but just one tiny problem, however I try, there are 3 separate plots on 3 graphs rather than 3 plots on the same graph.
> I don't know why the hold function ain't working.
> Please advise.
> Hey Ross, thanks for all the help, your code gave this error 
> ??? Error using ==> and
> Too many input arguments.

hmmmm ... maybe some missing parentheses in my for loop? I don't have matlab with me now, so perhaps you can try to sort it out if it fails again?

Zlist=[1.2 1.3 1.4 ];

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