From: Anthony Hopf on
But what if you want to replace the values?

m(any(m ==0,2),:)=[1 1 1];

This doesn't work, I get a dimension mismatch problem.

Thank you


"us " <us(a)neurol.unizh.ch> wrote in message <hs1qg9$psa$1(a)fred.mathworks.com>...
> "Rahul Singhal" <rsinghalomatic(a)gmail.com> wrote in message <hs1pti$hmk$1(a)fred.mathworks.com>...
> > Hi All,
> > I have a matrix containing 1's and 0's. I want to remove the rows that contain all 0's. Is there any matlab function that can do this.
> >
> > Can anybody help me in this.
> >
> > Thanks
> > Rahul Singhal
>
> one of the solutions
>
> m=[
> 1 2 3
> 0 4 5
> 0 0 0
> 6 0 0
> ];
> m(all(m==0,2),:)=[]
> %{
> % m =
> 1 2 3
> 0 4 5
> 6 0 0
> %
>
> us