# Tagged Questions

Questions on the manipulation of matrices in Mathematica.

143 views

### How to write the Taylor expansion of the sum of several matrices?

When $A$ and $B$ are matrices, we have the following Taylor expansion for the inversion function together with basic information on convergence:  (A+B)^{-1}=A^{-1}-A^{-1}BA^{-1}+A^{-1}BA^{-1}BA^{-1}-...
247 views

### Why is Mathematica eating a row from QRDecompostion

I'm attempting to calculate the QRDecomposition of the matrix: a = {{1, 3}, {0, 5}, {2, -8}} QRDecomposition[a] The answer ...
67 views

### Creating a tensor from matrices

I have 3 nxn matrices that I'd like to combine into a nxnx3 tensor. Basically, I want a new nxn matrix where each element is a 3 tuple of the elements of the other 3 matrices at that same position. ...
107 views

### Matrix Diagonalization programming

I have a very simple problem, with me misunderstanding the use of Modules and Functions in general, in mathematica. I have a function of which I want to input a Matrix, and in the function I want ...
92 views

### How to Extract and Rearrange Elements in Doubly-Nested Lists

Hopefully any easy problem for you guys to help me with! I'm currently having an issue with writing some Mathematica code that will extract the each nth element in each array within a matrix, and then ...
457 views

85 views

### How to convert a matrix into a sparse matrix [duplicate]

If I have a matrix: row 1)1 0 0 4 row 2)0 0 0 0 row 3)5 1 0 0 row 4)0 5 0 0 row 5)0 0 0 9 How would I put it in a sparse matrix format: ...
247 views

### Speed-up the computation of this sum of small matrices

Given a matrix mat with a large number of rows (a few thousands) and a few columns (between 2 and 10), I'd like to compute the sum of the "small" matrices obtained ...
92 views

### A few tuples at a time?

I want to generate $n$ by $n$ binary arrays, and then reduce the output from those arrays by performing a number of permutations and eliminating duplicates. The problem is that the number of arrays ...
520 views

### Polar Decomposition

I'm new to Mathematica 10 (half-a-month user). I'm looking for a function of polar decomposition but for now I cannot find it. Can anyone tell me about related functions. Thanks in advance.
447 views

### Given a large binary matrix, find the largest submatrix containing non-zero elements

I'm looking for a way to reduce a binary matrix containing zeros at some positions into a matrix that contains no zeros by deleting rows and columns of the original matrix until only non-zero values ...
44 views

### Problem with stress transformation using InputField [duplicate]

I want to write a code for application of the transformation matrix onto a second-order stress tensor. I have a problem with showing the results. My steps are as follows: 1) I create a Grid with ...
179 views

### Transform list of inequalities into matrix form $A\ x \leq b$

I have a list of linear inequalities, and I want to get it into the form $A\ x \leq b$; i.e., find the matrix $A$ and the vector $b$. Is there any function in Mathematica that can that can do this?
47 views

### Singular matrices with index 1 [closed]

If $A\in \mathbb{R}^{n\times n}$, the index of $A$ is the smallest integer $k$ such that $rank(A^{k+1})==rank(A^k)$ I want to find a singular (id est $\det(A) == 0$) and non symmetric matrix $A$ ...
55 views

### Importing data, then plotting ListPlot. What's the most efficient way to write a code?

It should be a boring question to ask for someone, but this is very basic need which I haven't resolved by myself. I know I can use MapThread and pure function to make it short and beautiful, but even ...
95 views

### How can I get symbolic orthonormal eigenvectors for 3 by 3 hermitian matrix?

Using the following syntax, I can obtain the symbolic eigenvalues and eigenvectors of the following Hermitian matrix (a,b,c,d are all real parameters): ...
42 views

### How to build a matrix from blocks [duplicate]

Brief MWE Given ...
256 views

### How to convert a sparse matrix to a list of sparse arrays?

I have a matrix stored as a SparseArray. How can I convert it to a List of its rows, where each row is stored as a ...
73 views

### Is it possible to draw a line on a MatrixPlot that would reflect density of row values? [closed]

I have a MatrixPlot with some data and I'd like to draw a vertical lines representing the "average" (density) of that data for each row. Something like this for ...
176 views

### Finding eigenvalues in Mathematica: why so slow?

I am trying to find the eigensystem of a large sparse real symmetric matrix, and I only need the lowest 40 or so eigenstates. The relevant code is as follows: ...
96 views

### diagonalization function

If we have a matrix m which is n*n, how can I do mm=U^dagger m U which is a transformation ...
287 views

### How can I create a random symmetric matrix in this way?

The most straight forward way for me to think about is like this: ...
131 views

### Why has Version 10.3 precision reduced?

In version 7.0.1.0 and versions 10.0 and 10.1 the following is produced: ...
45 views

### How to find selected elements of inverse of a banded matrix without inverting it?

Is it possible to find some selected elements of the inverse of a large sparse matrix without inverting it? For example consider this Hermitian matrix (as a general case). ...
206 views

### Derivative of a symbolic matrix

I need to write an elasticity equations as: {{a*∂/∂x,b*∂/∂y},{c*∂/∂x,d*∂/∂y},{e*∂/∂y,f*∂/∂x}}.{{u},{v}} where a,b,...,f are ...
62 views

### LinearSolve on non-square matrices?

I just came across a strange behaviour for LinearSolve (on Mathematica 8.0.0.0). Consider the following definitions: ...
80 views

68 views

### Find inverse of the parametric matrix [closed]

I want to calculate the bellow parametric matric but I faced with this error: any suggestion?? ...
381 views

### Create a Pascal Matrix

I am trying to write a function that can create a Pascal matrix. So far I have ...
606 views

### Rotation matrix $\to$ quaternion

I found a very good link about quaternions in Mathematica , but I don't know how to create a quaternion from a rotation matrix. Can anyone help me, please? Update I need this: A rotation may be ...
80 views

### Find the generators and group description of a set of matrices [closed]

I have the following matrix elements: ...
133 views

### Repeated multiplication of a square matrix and a column vector in Mathematica

I am very new to Mathematica and StackExchange, so pardon me if I am repeating a question that has already been answered. I am trying to use Mathematica to do the following: u[n+1] = A.u[n] where A is ...