Hi, i think you need 4 counters, in this case you code will be like this:
Syb = []; counter1 = 0; counter2 = 0; counter3 = 0; counter4 = 0; for m =1:length(I_FinalOut)
for n=1:length(Q_FinalOut)
if I_FinalOut(m) > 0 && Q_FinalOut(n) > 0
counter1 = counter1 + 1;
Syb(counter1) = 0
elseif I_FinalOut(m) < 0 && Q_FinalOut(n) > 0
counter2 = counter 2 + 1;
Syb(Syb(end)+counter2) = 1
elseif I_FinalOut(m) > 0 && Q_FinalOut(n) < 0
counter3 = counter3 + 1;
Syb(Syb(end)+counter3) = 2
elseif I_FinalOut(m) < 0 && Q_FinalOut(n) < 0
counter4 = cpunter4 + 1;
Syb(Syb(end)+counter4) = 3
end
end
end
or other solution if only on if condition is ready for processing (true):
Syb = []; counter1 = 0; counter2 = 0; counter3 = 0; counter4 = 0; for m =1:length(I_FinalOut)
for n=1:length(Q_FinalOut)
if I_FinalOut(m) > 0 && Q_FinalOut(n) > 0
counter1 = counter1 + 1;
Syb(counter1) = 0
elseif I_FinalOut(m) < 0 && Q_FinalOut(n) > 0
counter2 = counter 2 + 1;
Syb(counter2) = 1
elseif I_FinalOut(m) > 0 && Q_FinalOut(n) < 0
counter3 = counter3 + 1;
Syb(counter3) = 2
elseif I_FinalOut(m) < 0 && Q_FinalOut(n) < 0
counter4 = cpunter4 + 1;
Syb(counter4) = 3
end
end
end