I start off with m = 1000 x 5 matrix, and I would like to remove first column to get 1000 x 4 matrix and repeat again for 1000 x 3 and so on. Is there an efficient way to do this? I see Insert to add columns or rows but don't see command for removing? I see maybe use the extract but is this only for a single vector extraction?
|
|
||||
|
Here is a way to do it with
|
||||
|
|
As has been shown there are a number of ways to do this. To summarize:
All of these:
Produce:
Each has a place. For the specific operation Timings with larger matrix:
(The |
|||
|
|
|
I am not sure this deserves a full blown answer but...
And to operate recursively
EDIT Replaced |
|||||
|




Most? – chris Dec 27 '12 at 16:31mat = {{1, 2, 3}, {4, 5, 6}}; mat = mat[[All, 2 ;; -1]]Screen shot: !Mathematica graphics – Nasser Dec 27 '12 at 16:46