I have an array of cells (11000x500)with three different types of elements. 1) Nonzero paired 2) zero 3) Empty cell
I would like to find all cases of a nonzero number between two zeros.
eg. A = {123 13232 132 0 56 0 12 0 0 [] [] []};
I need the following output
out = logical([0 0 0 0 1 0 1 0 0 0 0 0]);
I used cellfunand isequallike this
out = cellfun(@(c)(~isequal(c,0)), A);
and got the following conclusion
out = logical([1 1 1 0 1 0 1 0 0 1 1 1]);
I need help with the next step, where I can ignore the serial 1'sand only accept "1" between two0's
Can someone help me with this?
Thank!
source
share