I have an array S 440x120 in dimensions. There is another array T 440x1.
I need to append say rows of S to another array T1 based on the following conditions
- The rows appended must be from index say 100 to 200 in S.
- Only those rows with
T(100:200)==1should be included. This means that ifT(100)=0thenS(100,:)should not be included and ifT(101)=1thenS(101,:)should be included.
I tried using the following but it failed due to obvious reasons as it includes from the first index and not from the 100th.
T1=S(T(100:200)==1,:);
Is there a shorter way of doing this in matlab apart from writing a whole loop? Thanks for your answers.