# Tagged Questions

Questions on the manipulation of matrices in Mathematica.

316 views

### How do I create matrices with arbitrary list restrictions?

I want to randomly generate a square matrix of dimension n with entries in the list StartingEntries, and also satisfying that for any such matrix M, the matrix Inverse[IdentityMatrix[n] - M] has ...
277 views

### Elegant Matrix Combinations

Suppose you have a matrix (mxn), simplified for illustration m= {{a, b, c}, {d, e, f}} And a set of combinations (simplified for illustration purposes but can ...
247 views

### Mathematica not assigning variable correctly

So I have been fiddling with this the last hour and I just can't get it to work. I have 3 matrices of the same size which contain nothing but 0's in a list, I also have 3 matrices of the same size ...
295 views

### Generate Non-Singular Matrix of $n*n$ dimension

I want to create a function that will make an $n*n$ matrix which is non-singular that will always retrieve the same matrix (meaning that the matrix will not be random each time). I tried using the ...
120 views

### What is the best way to produce a symmetric semi-definite matrix using as few variables as possible?

As we know, there are only $\frac{n(n+1)}{2}$ variables in a symmetric $n$-dimensional semi-definite matrix. Is it possible to produce a $n$-dimensional semi-definite matrix whose trace is $1$ using ...
341 views

### Error using Solve on Matrix Multiplication

I am trying to make a function the will find that value of $x$ in the following equation: $x.a=b$ all values of $x, a, b$ are matrices. The dimensions of $x$ are unknown, but $a$ and $b$ have the ...
58 views

### Identify columns of a huge matrix just polynomially many rows chosen at random

I am interested in the following problem in combinatorics $\Cap$ Probability. Let $\lambda \in \mathbb{N}$ be a parameter. Consider a matrix of $2^\lambda$ rows and $2^\lambda$ columns. Each column ...
896 views

### How to generate a random matrix with specific parameters?

I want to use Mathematica to generate a random matrix with given dimensions, entries coming from a finite set, and with a determinant also coming from a finite set. (It's very important that the ...
839 views

### eigenvector bug?

Bug introduced in 7.0.1 or earlier and fixed in 10.0.0 I have a fairly simple $3\times3$ complex matrix,  M=\left( \begin{array}{ccc} \frac{7}{2}-\frac{i}{2} & -1+i & \frac{1}{2}+\frac{5 ...
225 views

### Custom Matrix product

I have a list: list1 = {{{a1, a2, a3}, {b1, b2, b3}}, {{c1, c2, c3}, {d1, d2, d3}}}; I want an operation that gives me: Is there a built-in way of doing ...
568 views

### Determinant of a large matrix and solution of a linear equation

I am trying to solve a linear equation in x, where the equation is given by Det[M]==0. The M is a symmetric matrix (dimensions 47x47) with an element equal to x and all other elements are equal to ...
352 views

### converting between forms - symbols/subscripts - matrix products

If I have a vector of the form (xp+y, x+yp) do you have a simple way of creating the following matrix and vector from it: {{p, 1}, {1, p}} * {x, y}, such that ...
474 views

### Listing matrices up to symmetry

I am interested in the equivalence relation on N x N binary matrices, in which two matrices are equivalent if one can be obtained by rotating/reflecting the other. I would like to obtain a list ...
408 views

### correct way to map a function on entries down the pages in a 3D matrix?

updated: added another method to the methods I tried below for completion. This is new way of doing it, but most likely not very efficient, did not time it I can only visualize 3D matrices in my ...
195 views

### Creating simple table

How do I create a table like this? I find it very hard to create the zero-row and zero-column. Edit: I am looking for a solution where a formula eg. Table or something else is being used. I can ...
218 views

### How to use adaptive precision in matrix computations?

I wish to compute the pseudo inverse of rectangular (or square) matrices by the cubically method of Chebyshev given by $X_{k+1}=X_k(3I-AX_k(3I-AX_k))$ where $X_0=\frac{1}{\|A\|_F^2}A^*$. The procedure ...
202 views

### Construct an infinte matrix with finite sub-matrices

How can I construct an infinite matrix with finite sub-matrices of the form A = (B0, 0, B1 0, B2, 0 0, 0, B3) where each Bi is a rectangular or a ...
520 views

### RowReduce for symbolic matrices

I'd like to invoke RowReduce on some matrices with a time parameter. For example consider A = {{1, 0}, {0, t}} If ...
390 views

### Assigning row of values to a lower triangular matrix

I want to assign a linear row of values to the elements of a lower triangular matrix, i.e., if the row of values is {1,2,3,4}, then the matrix (4 X 4) should be: ...
431 views

170 views

### Sorting a list of triplets by first element of each triplet fails

In the last line of code, I´m trying to order the matrix by the first column. I want to store in the Array t2tlistsorted ( 100 x 3 ), but I can´t. ...
1k views

### How can I visualize 6 square matrices as a cube?

I have six square matrices of the same dimensions in a list, for example: ...
76 views

### Basic Row Traversal Question

Right now I'm using this For loop to do an operation to each row of a $n \times n$ matrix, I was trying to figure out how to do this with ...
155 views

### Finite precision - how to get rid of “near zeros” [duplicate]

I am performing a finite-precision operation on a matrix A which I know precisely; call the result B. The operation is taking ...
253 views

### Need an efficient method for finding certain matrices

I am trying to write a function which produces square matrices with certain characteristics. The function should have two inputs: number of the rows, n number of ...
190 views

### Output to preserve dot product

I am fairly new to Mathematica and I am faced with a problem. I tried to search for the solution but it seems that I don't know how to formulate the short search request. I need to perform a matrix ...
36 views

### Eigenvalues for large matrices without Root-Solution [duplicate]

I read some other questions and tried to implement the given answers but yet, I did not succeed to find proper solutions for my eigenvalues. I hope someone can show me how to do this for this case, ...
112 views

### NMaximize with matrix input

I defined function f[x_, fixed_] := {...}. Here x is an $M\times N$ matrix. I want to maximize $f$ with respect to $x$. I have ...
214 views

### Hermite Normal Form in “columns” convention

After describing the Hermite Normal Form (HNF), MathWorld explains: The Hermite normal form for integer matrices is implemented in Mathematica as ...
240 views

### Most efficient way to sum over matrix products?

I have two lists. The first, coefficientlist, is dense and has dimension {176,176} elements. The second, ...
606 views

### Analytically solve the eigenvalue problem with infinite dimensions by Mathematica?

If I am given a symbolic expression of all the matrix elements in an infinite-dimensional space, e.g., the Hamiltonian of a quantum mechanical system, is it possible to get the symbolic expression for ...
606 views

### How to find the position of non consecutive numbers?

Given a sorted table, how can I find the position of non consecutive numbers in the first column of the table? ...
107 views

### PermuteSubgraph not working? (Combinatorica)

I am trying to write a code to perform the QAP partialling analysis (here's a paper to know more) but the part in which I "scramble" the graph with PermuteSubgraph does nothing, I am actually not ...