I have the following matrix
test = [1 2 3 4;
2 3 4 5;
3 4 5 6;
4 5 6 7;
5 6 7 8];
I would like to select the rows whose first entry has a value between 1 and 3. I tried with
test(test(:,1)<3 && test(:,1)>1)
but that gave me an error. Then I tried with
test(1<test(:,1)<3)
but that doesn't give me the desired result 2 3 4 5
. Is there a way to obtain this is Matlab?