find sequence in a matrix
Hi, it possibile to velocize it and avoid loop? (I will be a matrix .,not a single array)
(if is possible to use vectorization)
I=[0 1 0 1 1 1 0 0 0 1 1 1 0 0 1 0 1 0]
k=3;
for i=1:numel(I)
if i>=k+1
if I(i-1) && ~I(i) %%i want to find the first "1 0"
saved=i;
break;
end
end
end
savedHi, it possibile to velocize it and avoid loop? (I will be a matrix .,not a single array)
(if is possible to use vectorization)
I=[0 1 0 1 1 1 0 0 0 1 1 1 0 0 1 0 1 0]
k=3;
for i=1:numel(I)
if i>=k+1
if I(i-1) && ~I(i) %%i want to find the first "1 0"
saved=i;
break;
end
end
end
saved Hi, it possibile to velocize it and avoid loop? (I will be a matrix .,not a single array)
(if is possible to use vectorization)
I=[0 1 0 1 1 1 0 0 0 1 1 1 0 0 1 0 1 0]
k=3;
for i=1:numel(I)
if i>=k+1
if I(i-1) && ~I(i) %%i want to find the first "1 0"
saved=i;
break;
end
end
end
saved find sequence in a matrix MATLAB Answers — New Questions