Hello Matlab Senior Users
I have a column of data 0 and 1 and the example data is like this format. There are 2 number of continous 1 value group. I don't want all groups of 1 values. I need only the number of continuous 1 value groups. It is 2 for this sample data (index 3 to 4 and index 6 to 8).
00110111010100
I tried some code like this suggested by some expert. But the answer is not correct.
ids=find(x==1);choice=diff(ids)~=1;ids([true;choice])indexes=ids([true;choice]);groups=numel(indexes)
If someone kindly advice me in for loop or while loop if will helpful for me.
Thank you very much for your helps.
Best Answer