# Tagged Questions

Questions on the manipulation of matrices in Mathematica.

93 views

### Extracting a time series from a sound object

After importing a sound file, how can I generate a time series (preferably as an $n\times 1$ matrix) which gives the intensity at equal time intervals?
526 views

...
99 views

### Unexpected inefficiency when calculating matrix product by Dot

There is an unexpected inefficiency when I calculate matrix product by Dot. The only relevant part of my code is presented as follows: ...
72 views

### Null space of a stochastic matrix [closed]

I want to calculate NullSpace of a matrix m - IdentityMatrix[n]. Normally I would do it with ...
159 views

### Pauli matrices — simplify expressions without printing out the raw matrix

Squaring a Pauli matrix results in the identity matrix. These bits of documentation (weakly, to a Mathematica-newbie like me) imply that some algebraic identities that link the Pauli matrices ...
35 views

### Why is there a different eigenvector for the same matrix? [duplicate]

I have a matrix that depends on two variables x and y. Matrix[x,y] When I make x=-.25*(1 - 1/3) + .25*(1/3) + .25 y=0 I ...
324 views

### How do I create a triangulated surface from points?

I have a set of points in a nx3 matrix and I would like to convert them into a surface, so that I may calculate its surface area. The function ListSurfacePlot3D creates the surface how I want it. ...
165 views

### Matrix Plot: How to Apply color function to only a region of the plot

I want to make a matrix plot where a color function is applied to a region of a matrix. Those matrix elements which were not in the region specified should not have any color associated with them, and ...
68 views

### How to specify positions in a matrix by an array?

If I have an array of sets of points such as pts = {{2,4},{1,3},{5,7}} Is there any super short command to use those pairs to output their respective elements in ...
94 views

### How do I store Eigenvalues of a 14*14 matrix in a For loop into an array and then plot that array? [closed]

I have a matrix 14*14 that is dependent on parameter a. How can I plot eigenvalues of the matrix according to varous values of a?
210 views

### Add values from a list, at positions from a list, to a matrix

I'm investigating matrix assembly and one of the things I'm trying to do is add specific values to a larger matrix based on a list which is essentially defining connectivity of nodes. For example: ...
47 views

...
86 views

### Normalized, symbolic Eigenvectors without abs(), sign() etc

I'm trying to compute the normalized eigenvectors of a matrix M = {{0, 0, 0, 0}, {0, 0, M5, 0}, {0, M5, 0, M4}, {0, 0, M4, 0}} If I try Normalize ...
46 views

### vector product defined on kronecker delta [duplicate]

I have some vectors such as : a={{0}, {0}, {0}}; b={{1}, {1}, {1}}; c={{1}, {1}, {0}}; I wanted to product a by ...
61 views

### formatting matrix

I have imported a matrix from data file which was generated in Matlab. The problem is the character (") in beginning and end of every row. So I can not perform any operation on it. How to get out ...
188 views

### Eigenvalues of matrix not giving imaginary parts

This might be a very simple problem, but I can't seem to figure out why I am getting this. I am trying to find the eigenvalues of the matrix: ...
66 views

55 views

### Designing a loop that fetches 5 random vectors each with 5 components from a set of 10 until Linear dependence is found

I am currently trying to find a way to make a loop that will select 5 random columns without replacement of a 5x10 matrix until it finds a determinant equal to 0 out of the new matrix formed by the 5 ...
41 views

### Problem with writting into a matrix in Mathematica [closed]

I have declared a matrix using S = ConstantArray[0, {246,246}] And when I try to write into it by a loop I get the following error "Tag Times in 0\ Null is ...
95 views

### how to partition the matrix into blocks of different dimensions

i have a matrix ...
156 views

### Strange bug involving a list, “Objects of unequal length” [closed]

sortedTally is a list generated from Tally sortedTally[[1]][[1]] is a list If I print: ...
72 views

### How to count column occurrences in a matrix?

I have a matrix of data, and I want to count the number of columns that match, and have some way to organize them by frequency. But I don't want to count the entire column, but consider the matrix ...
90 views

### How to swap tensor indices without permutation?

Say I have a tensor of rank R, How to swap $i^{th}$ and $j^{th}$ tensor index? I do not want to use TensorTranspose because it requires to write down the entire permutation, i.e. ...
533 views

### Defining quantum-mechanical Bra and Ket operations

I have the following ket in the Fock basis: $\vert3, 0 ,1\rangle$, where each entry defines the number of photons in a particular mode and can take any one of the following numbers: 0, 1, 2, 3. As a ...
177 views

81 views

### Symbolic matrix calculation [closed]

I have question about a matrix calculation like $\mathbf{b}^{t}\,\Sigma\,\mathbf{b}$, where $\Sigma$ is a 7 by 7 matrix, and $\mathbf{b}$ is vector of 7 elements, and each element in the vector ...
71 views

### Symbolically solve system of equations involving matrix

I need to solve the following system of equations symbolically for a_i, b_i, and c_i: ...
114 views

### Extract coefficient matrix $A$ from expression $f(x)$

I have expression: $$f(x)=\sum_{i=0}^{K-1}\sum_{j=0}^{N-1}a_{i,j}e^{ix}x^j.$$ I want to extract coefficient matrix $A$ from expression $f(x)$ where A=\left( \begin{array}{ccccc} a_{0,0}& ...
249 views

### $\mathbf L\mathbf D\mathbf L^\top$ Cholesky decomposition

Mathematica can do a Cholesky decomposition $\mathbf A = \mathbf L\mathbf L^\top$, but how do I do a LDL decomposition $\mathbf A = \mathbf L\mathbf D\mathbf L^\top$, with $\mathbf L$ being a unit ...
144 views

### Factor out a constant from a matrix

I've got a matrix in which every entry is of the form x/4. I cant find out how to factor out the 1/4 so that the actual matrix is clearer. Thanks for your help!
635 views

### Why is calling Dot with many arguments so inefficient?

Say I want to multiply a reasonably large list of symbolic matrices. ...
66 views

### Efficient Implementation of Resistance Distance for graphs?

Is there an implementation of the resistance distance matrix (or just resistance matrix) for graphs available in Mathematica?
45 views

### in the part assignment is not a symbol, create different matrices with a “Do” loop [duplicate]

Im trying to assemble new matrices from some previous matrices I have created, but I can´t. What Im trying to do is the following: 1) I have different matrices: ...
54 views

### Returning functions that are partly evaluated

I have some performance issues when calling Table[{h, Slow1[h, n]}, {n, nlist}, {h, 0.1, 10, 0.5}]; for a given list ...
101 views

### How to construct a kernel from a function?

I would like to convolve an image with a mathematical function. I understand that I need to have the mathematical function in a matrix form. How can I build it? Thanks
284 views

### Why does partitioning increase Dot execution speed?

I have noticed that multiplying a list of matrices can be significantly sped up by partitioning the list, calculating the product of the partitions matrices, and then multiplying the results. ...
90 views

### whats wrong when I use for loop for creating a matirx? [closed]

When I use separate value for "i" and "j", I got the correct desirable answer. a = 2; i = 3; j = 3; !(*SubscriptBox[(matrix), ([([a])])]) = {{1, 1, 3}, {7, 4, 7}, {2, 6, 8}}; value = ...
35 views

### Multiplying columns of a list of matrices

I have the following list of matrices ...
93 views

### Symbolic matrix inversion

If I try to get an inverse of a matrix: a | b | c b | d | 0 c | 0 | 0 Inverse[{{a, b, c}, {b, d, 0}, {c, 0, 0}}] I get the answer: ...