I have a vector of
P_1= [1 3 4 11 10 15 19 0 0 0 0 0 0 0 0 0 0 0 0 0]
and I want to see if each sequence of steps can be found in a larger matrix
N= [1 21 32 12 63 13 43 124 34 54 11]
.
I want to construct a new matrix Q that states if P_1(1:2) belongs to a row in N, then it should give a 1, otherwise 0. Therefore, I should get a Q matrix of [0 1 0 0 0 1 0 0 0 1]. I already have the following:
for z=1:19 for x= 1:10 if P_1(z:z+1)==N(x,1:2) Q(x,1)=1 else Q(x,1)=0 end end end
Best Answer