-
1 Comment
Swati Sarangi
on 10 Nov 2020
Can someone check this code?
function y = one(x)
split1= num2cell(x)
sum=0;
for i=1:length(split1)
if split1(i)=='1'
sum=sum+1
else
sum=0
i=i+1
y = sum;
end
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!