Questions on the manipulation of matrices in Mathematica.

learn more… | top users | synonyms (1)

1
vote
0answers
12 views

Array Flattening arrays of matrices given by rules

Fix an $n$ and an $m$ positive integers.I have some set of four $n\times n$ matrices $A$,$B$,$Y$,$Z$ (where $Z$ is the zero matrix). I'd like to input the $nm\times nm$ matrix of block matrices given ...
1
vote
1answer
65 views

Update: Calculate Tensor products and traces with Mathematica

My goal is to algebraically simplify expressions involving tensor products and taking the trace. That is, I would like to compute $\operatorname{Tr}\left( \prod_i(id+a_i \otimes b_i) \right)$, using ...
7
votes
6answers
425 views

Brackets around each item in matrix

I have a matrix where every item in the matrix has its own brackets that I do not want. How can I remove the brackets around each item?
0
votes
0answers
23 views

MatrixForm in Mathematica [duplicate]

I wanted to do subtractions between to matrices and I did the following ...
0
votes
0answers
48 views

Why doesn't mathematica evaluate the cells?

I have the following code in mathematica. Everything was ok and I was simplifying but suddenly mathematica crashed and after that it seems that it doesn't evaluate the functions. ...
0
votes
1answer
61 views

what do those signs #1, #1^2, #1^3, & mean here? [duplicate]

I have read common pitfalls page and the documentation page but I still don't understand what do those signs mean here? ...
-7
votes
2answers
58 views

How to solve for the eigenvalue in matrix? [on hold]

For which value of $a$ in the matrix {{a,2}, {3,4}} has the matrix eigenvalue of $0$? How to solve it in Mathematica?
3
votes
1answer
71 views

Calculating products of given length of two matrices

I have the following problem to solve. Let us have two given square matrices $A$ and $B$ of the same size and a positive integer $n$. I would like to produce all products of length at most $n$ of ...
-1
votes
0answers
22 views

non negative matrix factorisation [closed]

i am working on a project involving the use of non negative matrix (NMF) for the separation of a mixture of audio signals.can please give me the mathematical explanation of NMF so that i can ...
6
votes
1answer
138 views

Incorrect Left and Right Eigenvectors in Mathematica

I'm trying to find the Left and Right Eigenvectors of a pretty straightforward matrix, but Mathematica doesn't seem to be able to do it for even a 200 dimensional matrix. Background: Given an ...
4
votes
0answers
126 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: ...
0
votes
3answers
70 views

Constructing an arbitrary dimensional matrix with a certain rule

I want to construct the following matrix $M$ of dimension $(N+1)\times(N+1)$ with the following rule (for arbitrary N). Below, in the subscript, as usual, the 1st index gives the row and the second ...
2
votes
1answer
31 views

Encoding/Decoding matrices as integers, integers as matrices [closed]

I want to convert large binary matrices of m x n dimensions into integers, and then to convert these integers to the original matrices. I attempted the following: ...
1
vote
1answer
62 views

Monitoring a matrix with changeable elements as Manipulate in plotting [closed]

If we remember, Mathematica has an ability to show a Psudo-window of plots for monitoring the effects of some changeable parameters in the functions. For example ...
-2
votes
0answers
29 views
1
vote
1answer
74 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 ...
2
votes
2answers
95 views

plotting eigenvalues with devoted level coloring

I am about to plot eigenvalues of a matrix versus varyingj's. ...
5
votes
1answer
44 views

Constructing a particular Toeplitz matrix with a certain rule

I want to construct a Toeplitz matrix in Mathematica. Usually it is done in Mathematica using the following command: ToeplitzMatrix[{a,b,...},{a,y,...}] I want ...
0
votes
2answers
70 views

Flipping random elements in a matrix

I'm still a beginner with mathematica so maybe the solution is obvious, but for some reason my code that worked fine earlier doesn't work now. I haven't changed anything about it. I've restarted ...
0
votes
1answer
34 views

What is the function “oneflag_:0” in this expression? [closed]

The first function Pivotdown can zero out all entries in a column below a desired location. But l don't know the function of “oneflag _0".
1
vote
1answer
39 views

Generate a simulated covariance matrix

I am working on a problem where one of the input variables is the level of covariance between the entries in a particular matrix. To simulate this problem in Mathematica, I will need to feed my code ...
4
votes
1answer
53 views

Computing the logarithmic spectral norm rapidly

I wish to compute the logarithmic spectral norm of a square matrix $A$, which is defined by \begin{equation} \mu_2[A]=\lim_{t\downarrow0}\frac{\|I+tA\|_2-1}{t}. \end{equation} Hence, I simply code ...
5
votes
3answers
212 views

Make a vector of sums of matrix rows

I have a matrix in Mathematica: ...
0
votes
1answer
30 views

Picking some elements of a matrix and generating another matrix [duplicate]

If we have a nested matrix as: start={ {{1, 2, 2, 3}, {1, 1, -2, 1}, {3, 2, 2, -I}, {1, 2, 0, -I}}, {{3, 4, 4, 0}, {1, 1, 4, 1}, {3, 3, 4, -1}, {1, 1, 2, I}} } ...
2
votes
1answer
36 views

wrong result of an iteration related to replacement and comparing

We have two nested matrix and a code for replacement following an equality as: ...
1
vote
3answers
112 views

Conditionally binarizing matrices

I want to (fastly) convert matrices with values that are <= a threshold to binary matrices. I used a call to Binarize, but I don't like the Image and ImageData conversions as they obfuscate the ...
4
votes
2answers
79 views

replacement in a nested matrix

We have a nested matrix m1 = {{{1, 2, 2, I}, {1, 1, -2, 1}, {3, 2, 2, -I}}, {{3, 4, 4, I}, {1, 1, 4, 1}, {3, 3, 4, -1}}}; we must replace the first number of ...
4
votes
0answers
73 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: ...
2
votes
1answer
52 views

Why the curly bracket? [closed]

Why are there the curly braces in the output of DY = {{Cos[ay], 0, Sin[ay]}, {0, 1, 0}, {-Sin[ay], 0, Cos[ay], 0}}; DY // MatrixForm It looks inconsistent ...
3
votes
1answer
114 views

Hasse Diagrams from Adjacency Matrix

Let's say I have a rather large adjacency matrix for a partial order relation. Say an 80x80 matrix. What is the best way to display Hasse diagram? I have tried AdjacencyGraph and it does a not so bad ...
1
vote
2answers
84 views

Partial comparison between lists contained in larger matrices [closed]

Please presume we have two nested matrices m1 and m2: ...
0
votes
1answer
51 views

generation a nested matrix with a partly comparison of two other nested matrices [closed]

(this problem is maybe challenging because of its partly comparison) there are two nested matrices: mainmatrix1: ...
4
votes
3answers
201 views

Creating a nested matrix from two lists

I have a matrix and two lists: ...
1
vote
1answer
74 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 ...
0
votes
1answer
31 views

Lift and projection method in Least Squares Inverse Eigenvalue Problems [closed]

I need to implement the lift and projection method proposed by XUZHOU CHEN AND MOODY T. CHU in http://www4.ncsu.edu/~mtchu/Research/Papers/lsiep.pdf on page 7 in ...
3
votes
1answer
138 views

How to speed up filling a matrix as much as possible in a loop?

In order to find the solution of an $n\times n$ system of nonlinear equations by the method $x_{k+1}=x_k-D_k^{-1}f(x_k)$ where $D_k$ is an approximation of the Jacobian and defined by ...
2
votes
1answer
85 views

Product of $N\ 2 \times 2$ matrices and subsequently solving an equation dependent on the product

I have $N\ 2 \times 2$ matrices, each one containing one variable energy which may be complex. I want to muliply them all together to a single matrix ...
2
votes
2answers
104 views

Easier way to calculate Taylor remainder in 2nd order series

At the moment I have implemented the code for a Taylor 2nd order series for the function in three variables: $x_3^3+\frac{x_1-x_2}{x_1+x_2}$ The code builds on following expression: ...
1
vote
3answers
248 views

How to repeat a matrix on it's side?

I have the following matrix in Mathematica: mat = {{0,0,1,1}, {0,1,0,1}} I want to repeat this matrix N number of times on the side. For example if N = 3 then ...
3
votes
1answer
57 views

sorting eigenvectors of a final combined matrix

I have two matrices m1 and m2 as below: ...
1
vote
1answer
60 views

What's is the restrictions for the function MatrixExp?

When I use the MatrixExp on a general $2\times2$ matrix, Mathematica gives me this result: MatrixExp[{{a,b},{c,d}}] // TraditionalForm ...
5
votes
1answer
64 views

Would like to draw something similar to confusionMatrix created by ClassifierMeasurements

How do I show the values in each box? I know how to add the labels. Thank You
3
votes
3answers
115 views

Chopping matrix elements, real or imaginary

An undesired shape of a matrix has the following form: which is created by ...
2
votes
1answer
60 views

Mathematica's Solve[] and LinearSolve[] doesn't work to solve a system of equations IF parameters are not replaced

(I'm working on Mathematica 10.3) I have a system of 81 algebraic linear equations with 81 variables (variables are a1 to a81). ...
6
votes
1answer
130 views

What kind of Arnoldi method is used in Mathematica?

Can someone give me a bit more information about what mathematical method Mathematica is using, (preconditioner, filtering-restarting, deflation) in the Lanczos implementation when I input something ...
5
votes
4answers
133 views

Add to matrix missing elements (for list of time series)

This question is an extension of the 43122. I’ve looked through many interesting post (like this) but (as always) missed the direct matching. So the setting is simple: ...
3
votes
2answers
92 views

How to form binary matrix with constants and given probability?

I want to create a binary matrix of 6x3 in which six elements (m13,m23, m33, m42, m52, m61) are constant and assigned '0' value; whereas for other twelve elements (m11, m12, m21, m22, m31,m32, m41, ...
4
votes
1answer
90 views

How to increase the evaluation speed of this somewhat complicated table / matrix operation?

I'd like to calculate the following one-dimensional array: OneDimArray = Table[(Norm[Sum[ MatrixA[[i,j]]VectorB[[j]],{j,N}]])^2,{i,N}] However this takes a very ...
2
votes
0answers
34 views

Real Canonical Form of Arbitrary Size Matrices

I have been searching the site and the Mathematica documentation, but have not found anything regarding this. If we find the Jordan Form of the following matrix, we get complex values, but I would ...
1
vote
2answers
61 views

How to replace the selected value in matrix with a specific digit?

I want to replace the selected values through "RandomChoice" by 1 and all other values in matrix with 0. I want output in binary form matirx. ...