Questions tagged [matrix]

Questions on the manipulation of matrices in Mathematica.

Filter by
Sorted by
Tagged with
0
votes
1answer
35 views

Convert input word into vector matrix

I wold like some help of converting an input (word or number or mix) into a single row vector, such as the following: If input is ">DAVID123<" I want it to be as {>,D,A,V,I,D,1,2,3,<} where ...
2
votes
1answer
50 views

How to RowReduce a sparse matrix?

I want to compute the reduced row echelon form of a sparse matrix, but RowReduce returns a dense matrix. Is there a build-in function that computes the reduced form ...
0
votes
1answer
73 views

(Row?) reduction of a system of equations

For a mathematical problem I am trying to solve, I have (say) $(N+1)$ inhomogeneous linear equations in $M$ variables of the form $$\sum_{a=1}^{M}c_{i a}p_{a} = \xi_{i} \quad \text{ where } i=1,\...
2
votes
1answer
41 views

How to remove curly brackets in a two dimensional array near the edges?

Suppose I have a matrix {{1,2,3},{4,5,6}}. I want to remove the curly brackets near the edges, i.e., I want an output as '{1,2,3},{4,5,6}'. Somebody please help me to solve it.
8
votes
1answer
283 views

Optimization of the following code

Consider the function $$ h:[-1,1]\times I_{\sigma}\to I_{\sigma} $$ $$ (\omega, x)\mapsto \sqrt[3]{x + \sigma \omega} $$ where $ \sigma > \frac{2}{3\sqrt{3}}, I_{\sigma} = [x_-(\sigma), x_+(\sigma)]...
0
votes
1answer
31 views

Selecting solutions that evaluate to positive

How to extract symbolic outputs of Solve that evaluate to positive at given values of parameters? For example, if ...
4
votes
3answers
186 views

Eigenvectors in the limit $ \mu\rightarrow 0 $ are not the same as eigenvectors when setting $ \mu=0 $ from the beginning

I would like to find the eigenvectors of a matrix and see what the eigenvectors look like in the limit of $ \mu\rightarrow 0 $: ...
0
votes
0answers
21 views

Find the max 2nd entry of a vector in a matrix

I need to find the max of the numbers found in the 2nd entry of the lists of (7 lists of 3 lists of 5 numbers ) So example would be a 3 by 5 matrix where element in the matrix has a list . And I ...
1
vote
1answer
31 views

How to find a max of a certain matrix

find the Max of the numbers found in the 2nd entry of these lists. Also give its Position: Ex : {1 2 3 4 5} {1 3 4 5 6} {2 5 5 5 5} This is a 1,3 Matrix , and we want to get the highest number of ...
0
votes
1answer
20 views

How to save executing time of select list from multi conditions

I have a matrix: `MT={{1, 54, 55}, {2, 841, 5}, {3, 6, 65}, {4, 28, 328}, {5, 188, 21}, {6, 2, 887}, {7, 36, 32}, {8, 7, 2}}` And i need select the list which ...
5
votes
2answers
631 views

How to generate all $ 3 \times 3 $ matrices with $ a,a,a,a,b,b,b,c,c $?

How to generate all $ 3 \times 3 $ matrices with $ a,a,a,a,b,b,b,c,c $, which can not be obtained from each other by rotation transformation?
1
vote
1answer
55 views

How to remove global phase from matrices

I have a list of 3 by 3 complex matrices. I would like to remove the matrices that are similar up to a global phase factor. For instance, I have $ M, \mathrm e^{\mathrm i2\pi/3}M $ and $ \mathrm e^{-\...
1
vote
0answers
32 views

Getting a non zero determinant of matrix R, when the Rank of R is not equal to Dimension of R

I have a square matrix whose dimensions is 9 cross 9, when I extract the rank of the matrix R, I am getting rank as 6. I have constructed R matrix by minimizing the Lagrangian Lg with respect to a[1].....
0
votes
0answers
31 views

How to compute a system of ordinary differential equations with initial condictions over a continuous range

I have some questions about Mathematica programming and would appreciate if you could help me. I want to solve a system of ordinary differential equations \ [Mu] '[t] and \ [Lambda]' [t] and each ...
2
votes
1answer
75 views

Numerically solve system of 64 equations with 64 variables in matrix form

I have 2 matrix $A$ and $B$ both of size 16x16. Most of the values $A_{i,j}$ and $B_{i,j}$ for the same couple $(i,j)$ are equal to 0. The remaining ones are a positive floating number for $A$ and a ...
1
vote
0answers
15 views

How to minimize the eigenvalues of a hermitian matrix?

Suppose I have a complex hermitian matrix, M[x_,y_] whose eigenvalues must be real.I tried to minimize the first eigenvalue by writing following command:f[x_,y_]:=Eigenvalues[M[x,y]][[1]]; Minimize[f[...
1
vote
0answers
25 views

MatrixForm a product of matrices [closed]

I was hoping that MatrixForm[SingularValueDecomposition[{{1, 2}, {3, 4}}] ] would neatly display the singular value decomposition of a matrix in the form of a ...
0
votes
2answers
70 views

Matrix equation solving

I am new to Mathematica and I try to apply the solution given to this problem. So I have: $$A = \begin{pmatrix}50 & 3 & 10 & 2\\\ 3 & 60 & 7 & 1\\\ 10 & 7 & 55 & 4\...
1
vote
0answers
49 views

How can I evaluate a symbolic matrix [closed]

For example if I have: Matriz = {{a, b}, {c, d}} Matriz2[a_, b_, c_, d_] := Matriz; when I run Matrix2 [1,2,3,4], the matrix is not evaluated. I would not like ...
2
votes
2answers
79 views

How to generate vectors with programming

I want to generate all possible vectors programicaly with entrys in $\Bbb Z_4$: $$A_j:=\begin{bmatrix}x_1\\ x_2\end{bmatrix}, \qquad x_i\in \{0,1,2,3\}, j=1,2,\cdots 16.$$
1
vote
0answers
28 views

Problems with the parametric Recurrence Table

I am trying to construct a minimization program where I have to minimize a function with respect to a matrix. This matrix enters into the optimization program in a convoluted manner together with data....
2
votes
2answers
85 views

rule-based element selection from a matrix

For simplicity, I give a (3,3) matrix below, though my matrix is of a larger dimension. My objective is, after some matrix manipulations, to select Maximum element(s) in a row and a column, and place ...
4
votes
1answer
60 views

find a maximum parameter for a range of target eigenvalues as a function of matrix dimension

I have a symbolic tridiagonal matrix of this form ...
4
votes
2answers
911 views

Two matrices that are not similar have (almost) same eigenvalues [closed]

I have two matrices $$ A=\begin{pmatrix} a & 0 & 0 \\ 0 & b & 0 \\ 0 & 0 & c \end{pmatrix} \quad \text{ and } \quad B=\begin{pmatrix} d & e & f \\ d & e &...
0
votes
1answer
35 views

diagonalisation of systems of symbolic equations from two cross products

A description of what I'm attempting: Given a generic vector $\vec{r}$ and a point in space $D$, I want to build a reference frame centred in $\vec{r}= (x,y,z)$, with one axis directed along the ...
8
votes
1answer
133 views

Getting scores from PCA

I'm not super familiar with Principal Component Analysis, but from what I understand, it sorts a vector in order of decreasing variance, and uses that to transform the vector to correlate variables ...
0
votes
0answers
38 views

Improve speed of NIntegrate for functions which are sums of complex exponentials

I need to improve the efficiency for numerically evaluating a matrix element, which uses NIntegrate of the several functions (which are all sums of complex exponentials). Creating the functions from ...
0
votes
0answers
45 views

What row do I change to make my determinant non zero?

I wish to make a matrix that has an inverse. I need rows that look like oscillating functions so I decided to base my matrix on ChebyshevT. This code makes an n by ...
7
votes
4answers
89 views

Take $ n^\text{th} $ sub-list with equal distances

I have been looking at Span, Take, etc. functions but I couldn't figure out how can I extract elements likes this ...
6
votes
1answer
83 views

Finding the null space of a large sparse matrix

I am trying to compute the null space of a large $n\times n$ sparse matrix. No matter how large the dimension of the matrix is, it will always look like as below: The figure on the left shows the ...
2
votes
3answers
76 views

How to use Array[] to evaluate block-diagonal matrix at different values

I would like to construct a diagonal matrix that is defined as a function and put it multiple times in a block-diagonal matrix each block evaluated at a consecutive integer. Let's say my matrix looks ...
2
votes
2answers
214 views

How to stack multiple matrices?

I have a matrix 'mat' and I would like to stack it k times $$\begin{pmatrix} mat \\ mat \\ mat \\ mat \\ mat \\ \vdots \end{pmatrix}$$ such that the result is also a matrix. I tried Join and ...
3
votes
2answers
753 views

Problem with Eigenvectors

When I want to calculate eigenvectors of the following matrix in Mathematica the only answer it gives me is zero vector, anybody knows how to fix this? here's my matrix : \begin{equation} X=\left(\...
0
votes
0answers
36 views

Definition of a matrix [duplicate]

...
0
votes
0answers
51 views

Creation of a matrix

I would like to write the matrix v[s_,ss_,qi,qj] :=( {{a/(2 r) DiracDelta[s - ss], a/r(HeavisideTheta[(s - ss) + r] - HeavisideTheta[(s - ss) - r])}, {a/r(HeavisideTheta[(s - ss) + r] - ...
0
votes
1answer
120 views

Can I diagonalize a 512 by 512 matrix? [closed]

...with Mathematica? Or is this going to be impossible? I don't want to start work if it is hopeless. I've already solved the problem on a smaller scale, which involved an 8x8 matrix. ...
0
votes
1answer
39 views

How to plot multiple functions in a graph with different colors?

I have a general {i,x,y} dimensional matrix, and I want to plot all "i" {x,y} matrices in one graph. How can I do it in a way that I can still distinguish each "i"th curve from the other (I mean ...
0
votes
1answer
58 views

How to carry a matrix in algebric form under “set delayed”

I have a small query and a related problem regarding the working methodology of Mathematica under set delayed/Do functions. Here is a simplified version of my problem. ...
5
votes
1answer
81 views

Find position equal columns of matrix

Consider the following rectangular matrix M = {{1,1,1,1},{2,2,4,4},{3,3,5,5},{9,9,3,1}} I would like to extract the position of equal columns. Is there a simple ...
0
votes
0answers
34 views

How to work with a $k$x$k$ matrix with $k$ undefined?

I have the following $k$x$k$ square matrix m: ...
1
vote
1answer
23 views

Eigenvalues and inverse of matrix which has matrix entries

Suppose I have a $2\times2$ matrix which contains $2\times2$ matrices as entries, is there a clean way to find the inverse of such object and compute its eigenvalues/vectors? My code is ...
1
vote
0answers
30 views

Simulating Stochastic Matrix Differential Equation with Arbitrary Autocorrelation Function

I want to numerically simulate a matrix differential equation that includes a stochastic (vector) Gaussian noise $\mathbf{n}$, where the different vector components are independent, and each component ...
5
votes
4answers
216 views

Manipulate a list: replace random position of a specific integer n times by 0

I have this matrix with 3 sublists: d = {{1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0}, {0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1}, {0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0}}; For ...
0
votes
0answers
34 views

Matrix Vector multiplication [duplicate]

I have a rather simple question which surprisingly i could find the answer theres a matrix $U $ whith is $4*4$ and a vector $A$ which is $4*1$ and when I wand to multiply them by $U.A$ operator i get ...
9
votes
3answers
398 views

Create Array from list of indices/values

Is there is a performat way to convert something like {{0,0},a},{{0,1},c},{{1,0},d},{{1,1},e} into {{a,b},{c,d}} The ...
0
votes
0answers
38 views

How to save a all matrices renewed in each iteration?

I have a (n by m) matrix , in which the elements are recalculated and replaced by new ones in each iteration. (In other words I have a loop in which the elements of the mentioned matrix are being ...
7
votes
2answers
164 views

Multiply vectors in a matrix by a matrix

I have a matrix of vectors e.g. mat1 = Table[Table[RandomReal[1], 2], n, n]; which is actually a matrix of cartesian coordiantes ...
5
votes
1answer
54 views

MatrixConditionNumber does not work in version 12.0

A = {{1., 0.}, {0., 2.}}; LinearAlgebra`MatrixConditionNumber[A]
17
votes
1answer
373 views

Efficiently defining a SparseArray function

I've got a fairly large SparseMatrix (~60,000 entries in a ~10,000-by-10,000 matrix) that depends on two parameters (im1 and <...
7
votes
3answers
574 views

How to convert diagonal matrix to rectangular matrix

Suppose you have the following diagonal matrix: $\left( \begin{array}{cc} a & 0 \\ 0 & \{b,c\} \end{array} \right)$ How can the above matrix be converted to the following rectangular one?...