Hot answers tagged

7 votes
Accepted

How to correctly replace scalars with matrices?

"MatrixFunction" will do what you want. Here is an example with "Sqrt": ...
Daniel Huber's user avatar
  • 50.3k
3 votes

Applying a function to every item in a column of a matrix

Using Fold: ...
Syed's user avatar
  • 49k
3 votes

Applying a function to every item in a column of a matrix

SeedRandom[0]; list = RandomInteger[10, {3, 4}]; One function applied to two columns ...
eldo's user avatar
  • 61.8k
3 votes

Finding equal values in a list

v = {13.51, 13.51, 12.36, 12.36, 12.36, 12.36, 12.85, 12.85, 12.85, 12.85}; Using Comap (new in 14.0) ...
eldo's user avatar
  • 61.8k
3 votes

Replacing parts of a matrix with lists

a = {{1, 0}, {0, 1}}; b = {13, 14}; Using SubsetMap: ...
E. Chan-López's user avatar
2 votes

Replacing parts of a matrix with lists

a = {{1, 0}, {0, 1}}; b = {13, 14}; I suggest ReplaceAt (new in 13.1) or MapAt ...
eldo's user avatar
  • 61.8k
2 votes

Applying a function to every item in a column of a matrix

SeedRandom[0]; list = RandomInteger[10, {3, 4}]; Grabbing the @eldo's list and playing with ReplacePart, we can apply one ...
E. Chan-López's user avatar
2 votes

Populate an upper triangular matrix from a vector of elements

Using TakeList: ...
Syed's user avatar
  • 49k
2 votes
Accepted

Matrix equations in mathematica

Any diagonal matrix with non-zero entries will solve: ...
ubpdqn's user avatar
  • 60k
1 vote
Accepted

Formulate and solve a system of linear, first-order ODEs in Mathematica

Starting all over again as correct equations posted. Since Mathematica index starts from 1 and not zero, it is easier to start your equations from 1 and not 0 as you showed. Let $\beta=\frac{S_{\gamma}...
Nasser's user avatar
  • 142k
1 vote

How can I force a matrix with variables to be interpreted as singular?

Create an explicit matrix-times-vector equation, with extra conditions that the vector not vanish and the determinant vanish. ...
Daniel Lichtblau's user avatar
1 vote

Finding equal values in a list

v = {13.51, 13.51, 12.36, 12.36, 12.36, 12.36, 12.85, 12.85, 12.85, 12.85}; Using PositionIndex: ...
E. Chan-López's user avatar
1 vote

Rows within a norm

SeedRandom[1]; m = RandomInteger[100, {5, 5}]; max = 130; Using SequenceCases: Rows ...
E. Chan-López's user avatar
1 vote

Rows within a norm

SeedRandom[1]; m = RandomInteger[100, {5, 5}]; max = 130; Using SequenceSplit (new in 11.3) Rows ...
eldo's user avatar
  • 61.8k
1 vote

Removing rows whose elements appear less than a certain number

list = {{10, 10, 1}, {7, 9, 1}, {6, 6, 1}, {10, 1, 1}, {10, 6, 1}, {7, 9, 1}, {6, 9, 1}, {7, 5, 1}, {0, 8, 1}, {6, 2, 1}}; Using ...
E. Chan-López's user avatar
1 vote

Removing rows whose elements appear less than a certain number

list = {{10, 10, 1}, {7, 9, 1}, {6, 6, 1}, {10, 1, 1}, {10, 6, 1}, {7, 9, 1}, {6, 9, 1}, {7, 5, 1}, {0, 8, 1}, {6, 2, 1}}; Using ...
eldo's user avatar
  • 61.8k
1 vote

How to pass arguments to the list of functions?

f[x_, y_] = x + y; g[x_, y_] = x^3 + y^2 + 2 x; functions = {f, g}; Using Thread: ...
E. Chan-López's user avatar
1 vote

How to pass arguments to the list of functions?

f[x_, y_] = x + y; g[x_, y_] = x^3 + y^2 + 2 x; functions = {f, g}; Using ComapApply (new in 14.0) ...
eldo's user avatar
  • 61.8k
1 vote

Element-wise multiplication of an array and a matrix

m = {{10, 20, 30}, {0, 1, 2}}; v = {x, y, z}; Using Cases: ...
E. Chan-López's user avatar
1 vote

Element-wise multiplication of an array and a matrix

m = {{10, 20, 30}, {0, 1, 2}}; v = {x, y, z}; Using Threaded (new in 13.1} m * Threaded[v] ...
eldo's user avatar
  • 61.8k
1 vote

Find position equal columns of matrix

M1 = {{1, 1, 1, 1}, {2, 2, 4, 4}, {3, 3, 5, 5}, {9, 9, 3, 1}}; M2 = {{1, 1, 1, 1}, {2, 2, 4, 4}, {3, 3, 5, 5}, {9, 9, 3, 3}}; Using ...
E. Chan-López's user avatar
1 vote

Find position equal columns of matrix

Using SequencePosition (new in 10.1) ...
eldo's user avatar
  • 61.8k
1 vote

Function for finding the nth unique minimum value in a list?

mat = {{0, 78}, {1, 0}, {2, 0}, {3, 11}, {4, 11}, {5, 11}}; Using Sort and FirstPosition: <...
E. Chan-López's user avatar
1 vote

Function for finding the nth unique minimum value in a list?

mat = {{0, 78}, {1, 0}, {2, 0}, {3, 11}, {4, 11}, {5, 11}}; Using TakeSmallestBy ...
eldo's user avatar
  • 61.8k
1 vote

Delete zero rows in a matrix

Using DiscreteDelta: ...
Syed's user avatar
  • 49k

Only top scored, non community-wiki answers of a minimum length are eligible