From: us on 14 Apr 2010 06:30 "Bruno Luong" > > r=regexp(char([0,m(:).',0]+'0'),'0','split'); > > n=histc(cellfun(@numel,r),1:4) > > % n = 2 1 0 1 > > > The above won't work for m = ones(4) for example. > Bruno well... let's stay calm, there's (almost) always a solution... :-) and more generalized... m=ones(4); del=zeros(1,size(m,2)); m=[ del m del ]; r=regexp(char([0,m(:).',0]+'0'),'0','split'); n=histc(cellfun(@numel,r),1:4) % n = 0 0 0 4 us
From: mb on 14 Apr 2010 08:54 My problem is solved. Thanx! mb
First
|
Prev
|
Pages: 1 2 3 Prev: How to make mcc function efficient Next: Hyperbolic geometry visualizations |