Linked Questions

-1
votes
2answers
304 views

Convenient methods to sum select rows (or cols) of a matrix? [duplicate]

What are some convenient methods to sum selected rows or columns in a matrix? This question Summing along rows or columns of a matrix only addresses how to sun entire rows or columns ie, by level. ...
0
votes
1answer
95 views

How to extract data from a list? [duplicate]

I have a long list of coordinates defined in some 8D space. I need to extract the first three coordinates only. How ? For example : ...
0
votes
1answer
50 views

Extracting second value of each sublist [duplicate]

How can one get the second value of every array inside the outside array? I have the following data data = {{10, 20}, {30, 40}, {50, 60}}; I want to extract ...
0
votes
0answers
48 views

Construct matrix B from columns of matrix A? [duplicate]

Starting with Mathematica and working with matrices, I am looking for a way to construct a new matrix B from columns of matrix A. For example, matrix a has 8 columns and 4 rows, I want matrix B to be ...
0
votes
0answers
43 views

Arithmetic operations on columns [duplicate]

I have imported a file, data.txt, then plotted columns 2 and 3 as function of column 1 using the commands below. ...
263
votes
12answers
45k views

Where can I find examples of good Mathematica programming practice?

I consider myself a pretty good Mathematica programmer, but I'm always looking out for ways to either improve my way of doing things in Mathematica, or to see if there's something nifty that I haven't ...
11
votes
10answers
632 views

Elegant way to map a function to only the last element of each sublist [duplicate]

Suppose that I have the following list, called test: test = {{{a1}, {a2, a3}}, {{b1}, {b2, b3}}, {{c1}, {c2, c3}}}; Now ...
10
votes
6answers
586 views

Multiplying two dimensional data by a constant

I have a list of lists of the form: {{1, 2}, {2, 4}, {2, 8}} But I want to multiply only the second dimension of that data by a constant. I know I could do this ...
22
votes
5answers
2k views

What is the most efficient way to add rows and columns to a matrix?

Say I have a matrix m and a vector v. ...
8
votes
10answers
332 views
3
votes
8answers
249 views

How Do I Perform Simple Operations On The Elements of a Table?

I have been using the function HistogramList to generate frequency tables off a data set. The code looks like this: ...
6
votes
5answers
244 views

Manipulating a sublist based on position

I have a huge list with huge sublists of the form list={{a,b,c,d},{e,f,g,h},{i,j,k,l}} I am looking for a way to manipulate these sublists based on the positions ...
11
votes
2answers
403 views

Are there advantages to using generalized Part extraction instead of specialized functions like First, Last?

There are many ways to extract different parts of lists in Mathematica. For example, the first part of a list v can be accessed either as ...
4
votes
2answers
415 views

How to combine two vectors into a matrix by columns?

I know it may sounds idiot, but I've been looking through the document, and couldn't find a way to combine two vectors say {a, b} and ...
12
votes
1answer
384 views

How to extract and replace submatrix of a doubly-periodic matrix?

How can I effectively extract and replace a rectangular subpart of a toroidal matrix, i.e. one where boundaries are connected at opposite ends? Since the submatrix can overhang the edges, a simple ...

15 30 50 per page