Prev: how to generate all vectors of length n with entries are 0's or 1's then sum over
Next: does matlab support php code
From: Anthony Hopf on 13 Jul 2010 14:17 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 |