I have a vector:
a=[0 1 1 1 1 1 1 0 0 1 1 1 1 1 0 0 1 1 1 0 1 ];
in which I would like to count the "areas" of zeros and the "areas" of ones. In the example above I have
4 areas of zeros and 4 areas of ones. Thank you!
matrixmatrix manipulationvector
a=[0 1 1 1 1 1 1 0 0 1 1 1 1 1 0 0 1 1 1 0 1 ];
Best Answer