"sr" wrote in message <infons$mb6$1@fred.mathworks.com>...
> "Florin Neacsu" <fneacsu2@gmail.com> wrote in message <infnml$4e3$1@fred.mathworks.com>...
> > "sr" wrote in message <infmmd$gqf$1@fred.mathworks.com>...
> > > Hi friends,
> > > I have a matrix with 124821 rows and 6 columns. I would like to plot column 6 versus column 5 when column 4 has certain value.
> > > Im using the following commands to do this.
> > >
> > > if find(A(:,4)==6435)
> > > plot(A(:,6),A(:,5))
> > > end
> > >
> > > but apparently it is plotting all the values of column 6 versus all the values of column 5 with out using my condition.
> > > Can someone help me how to do this.
> > >
> > > thanking you in anticipation
> > >
> > > cheers
> >
> >
> > Hi,
> >
> > try
> >
> > ind=A(:,4)==6435;
> > plot(A(ind,6),A(ind,5))
> >
> > Regards,
> > Florin
>
> Thanks very much Florin. But my 'ind' has several values. Is it possible to plot all of them in the same plot?? or can i use a loop for each ind, plot....
>
> cheers
Hi,
You do not need a for loop to plot. If you are new to Matlab and you have a C background it might take a while to get used to this. Matlab works better with "vectorized" code. Read some tutorials and you will get a handle of it quite fast.
Good luck.
Florin
