From: us on
"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
My problem is solved.

Thanx!

mb