443 views

### Part like Delete: How to delete list of columns or arbitrarily deeper levels [duplicate]

On trying to write this answer I reached the frustrating realization that I didn't have an efficient way to delete a list of columns or deeper level components in a simple way as ...
• 35.9k
472 views

### How do I use drop to drop the second element from all these sublists? [duplicate]

{{1, 2}, {2, 3}, {5, 4}} I tried to do this: Drop[#, {2}] & @@ {{1, 2}, {2, 3}, {5, 4}} but it gave {1} but what I want is {{1},{2},{5}}
963 views

### How do I delete items at the same position from every sub-list within a list? [duplicate]

We have data in a list called megadata where megadata[[1]] for instance are the temperatures of each data point, ...
94 views

### How to edit a list according to the other list? [duplicate]

Gday guys. This problem troubles me, and I hope you can help me solve it. Say I have two random lists L1={{2},{5},{1},{0},{4},{7},{8}} L2={2,5,1,0,4,7,8} and ...
• 105
73k views

### Elegant operations on matrix rows and columns

Question The Mathematica tutorial has a section 'Basic Matrix Operations', describing operations like transpose, inverse and determinant. These operations all work on entire matrices. I am missing a ...
• 7,557
3k views

### Given a large binary matrix, find the largest submatrix containing non-zero elements

I'm looking for a way to reduce a binary matrix containing zeros at some positions into a matrix that contains no zeros by deleting rows and columns of the original matrix until only non-zero values ...
• 181
20k views

### Correct way to remove matrix columns?

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 ...
• 1,953
1k views

### Benchmarking expressions

It often happens that I'd like to know which of two or more alternative expressions (that should evaluate to the same value) is fastest. For example, below are three ways to define a function: ...
• 11.7k
4k views

### List manipulation: Dropping first or last row or column of a matrix

How do I drop the first/last row or first/last column from a matrix? The general case is answered here but I am new to Mathematica and it the arbitrary case is unnecessarily complex. Suppose I am ...
• 483
228 views

### Looking for a better way to delete an arbitrary list of rows from a matrix

Delete is not suitable to delete the rows of a matrix, as illustrated below: ...
• 11.7k
523 views

### Drop selection of columns from a ragged array

I have an application where I need to drop some arbitrary list of columns from a ragged array (where of course the shortest array rows have at least all the specified columns). E.g., given a ragged ...
• 25.5k
617 views

### Matrix manipulation

Thank you for looking and answering this question. I am trying to create a new matrix from an old one. Meaning, I have a original matrix that's 20x20. I want to keep the first five lines of the matrix,...
2k views

### Adding extra column to an existing table [duplicate]

Suppose I have following table- 1 5 8 2 6 9 3 7 10 0 0 0 Now, I want to add another column by exporting a data file. Suppose contents of that ...
• 337
135 views

### Inverse of ArrayPad operation, or removal of first column and first row of matrix [duplicate]

I have some large matrices, which I need to remove the first row and first column (both of which are full of zeroes). In this sense I need the inverse of "ArrayPad". For example, consider the matrix: ...
• 731