# Tagged Questions

Questions on the manipulation of matrices in Mathematica.

0answers
22 views

### Compiling matrix multiplication using a list of matrices

I'm trying to create compiled function which computes a list of Gamma matrices named GammaM and multiply them within the compiled code. ...
2answers
47 views

### Create matrix using loop?

Here I have a list of numbers (900 numerical values) denoted as d1-1, d1-2, d1-3.....d1-30, d2-1, d2-2, d2-3........d30-30. I want to create a matrix (900x900) which is organized as the below picture. ...
1answer
67 views

### MatrixExp[m, v] not always faster than MatrixExp[m].v

For non sparse matrix m, is MatrixExp[m, v] supposed to be faster than MatrixExp[m].v? ...
2answers
64 views

### Large matrix: Finding eigenvalues and ordering it with respec to the highest coefficient of its eigenvectors

I have a 900x900 matrix to diagonalize. After diagonalizing it, I have a table of eigenvalues and eigenvectors. For convenience, I start with 3x3 matrix. ...
5answers
595 views

### Elegant method of generating this matrix?

Good evening, I need to determine an elegant (as possible) method of computing an $n\times n$ matrix below (the matrix shown is just a $16\times16$ example). I've been toying with ...
1answer
19 views

0answers
37 views

### Mathematica Not finding Eigenvectors? [duplicate]

I have the following matrix: mat = {{-60., 0., 2.1*10^-35 II + 2.1*10^-35 (-1. II + Istar), 2.1*10^-35 II + 2.1*10^-35 (-1. II - 4.7619*10^6/Istar)}, {-6.4*10^22 II - 6.4*10^22 (-1. II - ...
0answers
30 views

### Show full output for a matrix in mathematica [closed]

I have a very large rectangular matrix. It is an incidence matrix that I obtained from a bipartite graph data. I want to view the whole matrix. It only shows SparseArray[...] and specifies dimensions ...
1answer
74 views

### Tensors constructed using KroneckerDelta's - and/or displaying KroneckerDelta as a matrix

I am doing some work in elasticity and as a result am working with tensors. In particular, I would like to calculate the contraction of a fourth order tensor (the stiffness tensor) with a second order ...
0answers
37 views

### Optimization of the process of obtaining a global stiffness matrix

I created this code in a detailed manner so that i can understand. However it is not optimized. I think that may be a bit confusing. Anyone who is interested in analyzing and understanding my ...
0answers
56 views

### Creating a Symbolic Singular Matrix

I am trying to differentiate an expression involving a matrix. When evaluating the input, Mathematica assumes the matrix is invertible, when it is not. How do I specify a symbolic singular matrix to ...
1answer
83 views

### Matrix equations solving

can you explain me the easiest way for solving this matrix equation? I have this matrix: a={{-4,1,3,0},{-2,7,1,-1},{1,-1,9,-3},{-1,0,5,-10} and the Equation is: ...
3answers
3k views

### Flatten command: matrix as second argument

One thing I could never wrap my head around is how Flatten works when provided with a matrix as the second argument, and the Mathematica help isn't particularly ...
2answers
106 views

### How to export an output matrix obtained in mathematica to a matrix in python with the correct format?

I have a large sparse matrix as the output and I want to save the output and open it as a matrix in python. The output is a 6000 x 6000 matrix and I don't know how to make changes to the file such ...
2answers
57 views

### How I can calculate product of series matrices

How I can calculate product of series matrices: A= Im...In. In-1 ...I1 which In = {{n,7n-2,3,2n-1},{3,4,n,6n-1},{9,3,n,n-3},{n-2,1,8,7n/3}} thanks!
1answer
40 views

### How do I plot the columns of an $M \times N$ matrix as separate lines on the same graph using ListLinePlot?

I have seen many examples that show how to plot several functions on the same graph using ListLinePlot is this manner: e.g. ...
1answer
180 views

### Find positions where two matrices differ

I have two matrices A and B of identical dimensions. What's the simplest (shortest) way to find the indices of differing ...
3answers
342 views

### How to extract the list of all matrices from a Block Diagonal Matrix?

I am working on a function to do the opposite operation of How to form a block-diagonal Matrix from a list of matrices? Here is my current algorithm: For i ...
1answer
31 views

### Iterating certain variables in a predefined function [closed]

I have a function which is dependent on a number of variables. I need to evaluate this function at the particular locations given by, ...
2answers
185 views

### Elementwise dot multiplication for lists of matrices

I have lists of matrices and want to do element-wise matrix multiplication. Is there an easy way to do this that I've missed? e.g: {A, B, C}.{X, Y, Z} = {A.X, B.Y, C.Z} where A, B, C, X, Y, and Z ...
6answers
453 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: ...
2answers
350 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 ...
1answer
338 views

### Finite Field matrix rank calculation

How does one define a matrix over $\mathrm{GF}(p^r)$ in Mathematica in order to compute rank? I am working with $\mathrm{GF}(2)$?
1answer
85 views

### Subscripted (or superscripted) variables in Mathematica

When I first learned of Mathematica and started to use it, I soon discovered that Mathematica supported subscripted and superscripted variables such as $M_{i j}$. Naively, I first thought that I ...
1answer
55 views

1answer
109 views

### How to remove parts of an expression [closed]

I have an expression where terms Transpose[R].R appear. R is a matrix with the property Transpose[R].R=IdentityMatrix[3]. How ...