# Questions tagged [matrix]

Questions on the manipulation of matrices in Mathematica.

3,147 questions
Filter by
Sorted by
Tagged with
2 votes
0 answers
35 views

### Algorithm for the resolvent of a matrix, and LUBackSubstitution

Suppose A is a complex n x n matrix where n is quite big, given as a numeric array. For many ...
2 votes
0 answers
88 views

### Filling the space with rectangles

The problem concerns filling the matrix m x n with rectangles. ...
• 959
1 vote
1 answer
77 views

### Inverse of a matrix with symbolic variables

I want to evaluate the inverse of the following colossal matrix ...
• 393
0 votes
1 answer
42 views

• 625
11 votes
11 answers
2k views

• 123
3 votes
1 answer
133 views

### Construct Special matrix in mathematica

I want to define $D = [d_{ij}]$ as the $(N+1) \times (N+1)$ lower triangular matrix given by the following recursive definitions:  \begin{aligned} d_{i,i-1} &= i, \qquad\qquad \qquad i=1,2,\dots,...
• 703
0 votes
1 answer
35 views

### Partial Trace with KroneckerProduct

I have some symbolic expression of the form X=KroneckerProduct[A,B]+KroneckerProduct[G,F]+... How can I define a partial trace for this, i.e. a function f: ...
• 625
4 votes
1 answer
68 views

### Mathematica replaces list of zeros with zero [closed]

Consider the following functions: f[x_]:= {{Im[x], Re[x]}, {Re[x], Im[x]}}; g[x_]:= {{Im[x],0},{0,0}} When applying each of the functions to the list of lists <...
• 225
3 votes
2 answers
97 views

### Set of quadratic forms and linear algebra

I have a set of quadratic forms. $L_{1}=u_1^TJ_{1}u_1$ $L_{2}=u_2^TJ_{2}u_2$ $L_{3}=u_3^TJ_{3}u_3$ where $u_{i=1,2,3}$ - 3$\times$1 vector; where $J_{i=1,2,3}$ - 3$\times$3 matrix; I need to pack ...
• 1,636
8 votes
5 answers
498 views

### How do I flatten a matrix of lists while maintaining the structure of the list?

I have a 2x2 matrix of lists. For example, the matrix I am working with looks like matrix = {{{a,b,c}, {e,f,g}}, {{h,i,j}, {k,l,m}}} I want to define a function ...
0 votes
2 answers
49 views

### How to create a symbolic Matrix for evaluation at specific values

I want to create a symbolic matrix that I can evaluate at the given values of variables. Definitions: ...
• 4,391
3 votes
1 answer
76 views

### Imposing constraints on any undefined symbol appearing in a matrix automatically

I want to know how can I can I tell Mathematica that all symbols that appear in an object, e.g. a matrix, obey certain constrains, without having to write these conditions by hand. More specifically, ...
• 517
0 votes
0 answers
35 views

### Trying to map SparseArray over a defined list, the SparseArray defined with 3 subvalues i want to map the 3rd. subValue(list) over the defined list

I have a SparseArray already defined as following ...
3 votes
1 answer
43 views

### Trying to add up values into a matrix

first post here. I'm currently completely stuck and frustrated with mathematica. In retrospective, it might had been a mistake to use it for this, I'm actually considering to somehow export the ...
• 33
0 votes
1 answer
61 views

### Working with matrices problem with MatrixForm [closed]

I'm just trying to set up a Matrix 24 by 24 with indices that start from 0 to 23 ...
• 199
2 votes
1 answer
142 views

### How to construct this Matrix

A $4\times 4$ identity matrix $\mathbb{I}$ can be written as $\mathbb I=\delta_{ij}\delta_{kl}$. To construct this matrix, I wrote ...
• 397
2 votes
2 answers
82 views

### making elements of matrix into integers [closed]

how to make elements in a matrix into integers? here is my matrix: ...
• 245
4 votes
1 answer
87 views

### Efficient iteration of matrix multiplication into a table

Suppose I have a list of matrices $(A,B,C)$ and a vector $v$. I want to construct a table whose elements are sequential applications of these matrices to $v$, i.e., the first entry will be $Cv$, the ...
• 595
5 votes
3 answers
366 views

### Jacobian matrix evaluation at a point [duplicate]

I have a vector function $f(x,y) = (f_1(x,y), f_2(x,y) ).$ I need to find the Jacobian matrix for $f$ evaluated at the point $(x,y) = (a,b).$ I learnt that I can use something like the following on ...
• 53
2 votes
2 answers
88 views

### Proving (or refuting) TU (totally unimodularity) of a matrix nxm

I am new to Mathematica and want to prove the totally unimodularity of a matrix (not a particular one, but for any matrix input). A matrix A is totally unimodular (TU) if every square submatrix of A ...
• 131
1 vote
0 answers
61 views

### How to calculate the determinant for all the submatrix of a matrix?

I want to calculate (and see) all the submatrixes determinant for one non-square matrix with dimensions nxm. I know I can get the determinant of a matrix using Det(matrix), but I would like to know if ...
• 131
4 votes
3 answers
179 views

### Thread Matrices, like image channels

The code With[{matA=Partition[Alphabet[],5],matB=Partition[Range@25,5]}, (* matA and matB are 5x5 matrices*) MapThread[List,{matA,matB},2] ] is fairly ...
• 2,648
2 votes
2 answers
370 views

### How to put a FOR loop in a WHILE loop

I have a strange matrix like this one in the picture Now, my goal is to change all the 1s with random complex numbers of modulus 1, but if the element $a_{12}=z$, then $a_{21}= \bar{z}$, so the ...
• 123
1 vote
0 answers
29 views

### Solve the current equation with respect to one of the coefficients and substitute it into each equation of the system

Good day to all! In this question about recurrence relations, I had a simple case when the k + 1th variable is represented in terms of ...
0 votes
0 answers
62 views

### Solve coupled differential equation using Matrix

I am a complete beginner to Mathematica. I am trying to solve the following equation: $\frac{d}{dt}\rho_t = -0.5* \eta* \Gamma[\rho_t]$, where $\Gamma[\rho_t]$ is a 4x4 matrix whose coefficients are ...
0 votes
1 answer
38 views

### Reduce expressions into (simplified) matrix and vector forms

I have some computation that results in a rather complicated looking expression that could be much simplified by converting it into matrix or vector expressions. For example, instead of ...
• 206
0 votes
1 answer
61 views

### Adding every entry of two tables

I have to randomly create a polymer (random angle between parts), change a random angle by a bit (delta), and determine the energy difference. RandomAngle contains all the angles and DeltaTable ...