I have a large matrix A
, which is of size 105000 x 3. I would like to extract the first two columns of the matrix, whenever the third column = Val
.
I have tried:
Test = A(A(:,3) == Val);
However, this only extracts the first column. I cannot seem to figure out the syntax to pull out the first and second columns. I know to simply pull out the first two columns it would be Test = A(:, [1,2])
, so I imagine I need to combine these somehow?