Linked Questions
11 questions linked to/from Add a vector to a list of vectors
9
votes
5
answers
289
views
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....
0
votes
2
answers
250
views
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}...
198
votes
9
answers
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 ...
13
votes
6
answers
796
views
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:
<...
3
votes
5
answers
450
views
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 ...
8
votes
3
answers
388
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.
...
3
votes
4
answers
709
views
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 ...
2
votes
3
answers
181
views
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 ...
1
vote
1
answer
175
views
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:
...
2
votes
1
answer
96
views
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:
...
0
votes
1
answer
133
views
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:
...