bwlabel 関数を使ってみてください
A=[-210 -210 -33 -34 -33 -35 -30 -33 -210 -33 -33 -210 -210 -34 -36 -35 -210];
[groups, numGroups] = bwlabel(A > -210)
for ii = 1:numGroups
B(1,ii) = sum(groups == ii);
end
B
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!