Linked Questions

9 votes
5 answers

How to get this list with a terse method [duplicate]

If I have like {a,b} and I want to get {{a+1,b},{a-1,b},{a,b+1},{a,b-1}} We don't care about the ordering of the list....
yode's user avatar
  • 26.9k
0 votes
2 answers

How to sum a number over an element of each pair of a list? [duplicate]

Here's a following list: L={{a,b},{c,d},{e,f}}. I want a function such that it sums a number over the first element of each pair. For instance, take the number 1. I need: L={{a+1,b}, {c+1,d}, {e+1,f}...
Sara Perestrelo's user avatar
205 votes
15 answers

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 ...
sjdh's user avatar
  • 7,787
14 votes
7 answers

How can I multiply only a few columns of a table by some number in a compact way?

Consider a table tab = Table[{i,i^2,i^3,i^5,i^0.3,i^0.7},{i,0.2,3,0.1}]; I would like to multiply the 2rd and 5rd columns by some number. This is how I do it: <...
John Taylor's user avatar
  • 5,887
4 votes
6 answers

Subtracting a list from each sublist in a nested list

I have a nested list with 1-D sublists of equal length. I want to subtract another list from each of these sublists. Task: Subtracting B from each element in ...
reemodels's user avatar
  • 511
8 votes
3 answers

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. ...
OpticsMan's user avatar
  • 576
4 votes
5 answers

Multiplying a list a vectors by the same matrix

I have a list of 2 vectors: x={{a,b},{x,y}}, and a matrix 2 by 2 A. I want the result to be ...
An old man in the sea.'s user avatar
2 votes
3 answers

add columns of list {a0,b0} to columns of list {{a0,b0} ,{a1,b1} ,{a2,b2} ...{ax,bx} } [closed]

If I want to add the columns of {1,2} to each of the columns of say {{1,2},{3,2},{4,2}} resulting in {{2, 4}, {4, 4}, {5, 4}} How would I do this? and for any ...
onepound's user avatar
  • 343
1 vote
1 answer

ListPlot problem

I have the following example: x = {1, 2, 3, 4} y = {{1, 2, 3, 4}, {2, 3, 4, 5}, {3, 4, 5, 6}, {4, 5, 6, 7}} Now I can plot: ...
mrz's user avatar
  • 11.7k
2 votes
1 answer

How to add a vector list to a multiple dimension list of vectors [closed]

This problem is related to Add a vector to a list of vectors. Given: ...
user57467's user avatar
  • 2,788
0 votes
1 answer

Add list of vectors to list of vectors recursively

This question relates to Add a vector to a list of vectors whereas here I want to add list of vectors to list of vectors recursively. Given: ...
user57467's user avatar
  • 2,788