Hi Everyone,
I am working on a really simple project. I have a matrix A:
A =[0 0 0 1 1 0 0 0; 0 0 1 0 0 1 0 0; 0 1 0 0 0 0 1 0; 0 1 0 0 0 0 1 0; 0 0 1 0 0 1 0 0; 0 0 0 1 1 0 0 0];
The question is, how can I count how many 0 elements do I have between two 1 elements?
For example, in the second row, I have 2 zero elements between the two 1 elements. In the third row, I have 4 zero elements between the two 1 elements.
Many thanks in advance.
Best Answer