2k views

### Simple subtraction question [duplicate]

I have two lists. a = {{2, 2}, {3, 3}, {4, 4}, {5, 5}}; b = {1, 1}; I want to subtract a from ...
• 145
505 views

### adding offset to a list of points [duplicate]

I'm trying to duplicate this behaviour: {a,b,c}+1={a+1,b+1,c+1} in two dimensions. In other words I want to have: ...
• 701
1 vote
238 views

### How to extend "List-of-numbers-with-number" arithmetic to "List-of-X-with-X" arithmetic? [duplicate]

I'll start with a couple of examples (since this is all one can get from the documentation anyway). First, adding lists of numbers equal length is done term-by-term. E.g. ...
• 11.7k
80 views

### Extending listability to coordinates [duplicate]

I noticed that one can subtract a since real number value from all elements in an array by writing something like {5, 4, 3, 2, 1} - 5 which outputs ...
• 53
156k 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 ...
11k views

### How to implement the general array broadcasting method from NumPy?

A friend of mine introduced array broadcasting in the Python NumPy package which is very convenient (and also highly efficient). The idea is perfectly shown in this ...
• 17.1k
8k 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 ...
1k views

### How to use Map inside MapThread?

Given this input lst1 = {{a, b, c}, {d, e, f}}; lst2 = {1, 2}; and the goal is to generate this output ...
• 143k
678 views

### Adding list of list to a list

Hello I need some help on how to add a list to a list of list. The program would have to do as below: {{0,0}, {0}, {0,0,0}}+{1,2,3,4,5,6} will give ...
• 391
2k views

### How to multiply specific columns in a matrix of data?

So I need to make a plot of some ~2000 data points I have from a spreadsheet. I'm able to import the data just fine, it stores it like so sundat {{280.,0.082},{...
• 33
392 views

### Improving Map Function on Lists

Dealing with spectral data (2D lists) where offsets (corresponding 1D list) must be removed from each individual spectrum. Looking for feedback on improvements over my current method. ...
• 576
414 views

### Mapping a function over the parts of a deeply nested Array

I have two tensors: tensorS = Array[Subscript[s, #1, #2, #3, #4] &, {2, 16, 16, 19}]; tensorR = Array[Subscript[r, #1, #2, #3] &, {2, 16, 19}]; ...
• 127
239 views

### Greater operator should give greater element [duplicate]

4>3 gives True. What is the "greater_operator" to obtain the result 4? For lists accordingly: ...
• 11.7k
380 views

### Multiplying/dividing two unequal lists

I have two list which are not equal dimension: listA = {{{1, 2}, {2, 2}, {3, 4}}, {{1, 1}, {2, 2}, {3, 3}}}; listB = {{4, 4}, {5, 5}}; And I want to divide them ...
• 3,954