-
3 Comments
Qinghua Ye
on 16 May 2019
function y = lengthOnes(x)
a = [];
idx = [1,find(x=='0') + 1,length(x)+2];
le = length(idx);
a(1:le-1) = idx(2:le)-idx(1:le-1)-1;
y = max(a);
end
Sanzhar Askaruly
on 17 Jun 2019
no regexp is needed actually
Adnan Anjum
on 29 Jan 2020
Cool
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!