I want to count the number of 0s in a binary sequence which occurs for n number of times, where n=1:25.
Suppose I have a binary sequence A=[0 0 0 1 0 0 1 0 1 0 0 0 0 0 1 0 0 0 1]
Then I want to count in how many cases 0 occurs consecutively for n number of times preceded and succeeded by 1.
Here the desired output would be-
for n=1- noofzeros=1
n=2 – noofzeros=1
n=3- noof zeros=2
n=4- no of zeros=0
n=5- noofzeros=1
and so on….Suppose I have a binary sequence A=[0 0 0 1 0 0 1 0 1 0 0 0 0 0 1 0 0 0 1]
Then I want to count in how many cases 0 occurs consecutively for n number of times preceded and succeeded by 1.
Here the desired output would be-
for n=1- noofzeros=1
n=2 – noofzeros=1
n=3- noof zeros=2
n=4- no of zeros=0
n=5- noofzeros=1
and so on…. Suppose I have a binary sequence A=[0 0 0 1 0 0 1 0 1 0 0 0 0 0 1 0 0 0 1]
Then I want to count in how many cases 0 occurs consecutively for n number of times preceded and succeeded by 1.
Here the desired output would be-
for n=1- noofzeros=1
n=2 – noofzeros=1
n=3- noof zeros=2
n=4- no of zeros=0
n=5- noofzeros=1
and so on…. binary MATLAB Answers — New Questions