A=rand(100,3);
B=A(A(:,2)>0.4 & A(:,3)>0.5 , :)
...and this can be continued with other columns or with 'or'...you might even just return certain columns with..
B=A(A(:,2)>0.4 & A(:,3)>0.5 , 1)
"MAO " <mao_nut@yahoo.com> wrote in message <ij2uf8$41j$1@fred.mathworks.com>...
> Thanks, your comment helps me much.
> However, in the case where I have A = rand(100,3) and I want to keep only its rows whose the element of 2nd column > 0.4 and the element of 3rd column > 0.5 (the element of the 1st column is keep as it is generated), what can I do?
>
>
> "Sean de " <sean.dewolski@nospamplease.umit.maine.edu> wrote in message <ij1871$jln$1@fred.mathworks.com>...
> > "MAO " <mao_nut@yahoo.com> wrote in message <ij16vk$1fa$1@fred.mathworks.com>...
> > > I have a vector A=rand(100,1). I want to delete from this vector, the elements which are greater or equal to 0.5, for example. The vector A whose elements are smaller than 0.5 is now called vector B. How could I do to get vector B?
> >
> > %Delete Method: Glass half empty
> > B = A;
> > B(B>=0.5) = [];
> >
> > %Keep Method: Glass half full
> > B = A(A<0.5);
