Consider a matrix
(mat = Array[a, {5, 5}]) // MatrixForm
If I want to extract columns 2
through 4
which would return a 5x3
matrix, I can do that with:
mat[[;; , 2 ;; 4]] // MatrixForm
But what if I want to extract only column 2
and 4
(without column 3
), so that I get a 5x2
matrix? Is there a short syntax to do that?