i am using the code to find maximum zero span
g = [ 1 1 1 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 1 ]
pos1 = find(g==1);
zero_span = diff(pos1)-1;
max_zero_span = max(zero_span)
as from vector g we can see that maximum zero span is starting from location 3. how can i find this with the help of MATLAB.
Best Answer