Questions on the manipulation of matrices in Mathematica.

learn more… | top users | synonyms (1)

0
votes
0answers
79 views

Solving a system of equations involving partial derivatives for a wave

Before saying anything about the problem, I have checked "How to solve a system of partial differential equations?" yet it does not actually answers my question, as I have a 10x10 matrix to work on. ...
4
votes
3answers
280 views

Get Eigensystem to return orthogonal eigenvectors for Hermitian matrix

I have a Hermitian matrix, and I would like to get a list of orthogonal eigenvectors and corresponding eigenvalues. But when there are degenerate eigenvalues, sometimes Eigensystem/Eigenvectors ...
8
votes
7answers
291 views

Input a square matrix and return a list of the matrix entries read by antidiagonals

I have a square matrix: {{1,2,3},{4,5,6},{7,8,9}} and I want to get a list: {1,2,4,3,5,7}
1
vote
3answers
65 views

Form a matrix to have inequality elements

It looks like a silly question, but I could not find any answers online. Your help is greatly appreciated! Say I have two lists now. ...
0
votes
0answers
33 views

Does Mathematica support Laguerre Polynomials of Matrix Argument?

I am wondering whether Mathematica can also compute the Laguerre polynomials of matrix argument as the appear in multivariate statistics? For example, they appear in this paper here: ...
1
vote
1answer
68 views

Wrong generalized eigenvalues of large numeric matrices

I've been working on a toy model of a variational method of a Hamiltonian H with an overlap matrix S. The point is that when H and S are small enough, Mathematica gives the correct eigenvalues (≈ ...
5
votes
1answer
174 views

Largest matrix size supported by Mathematica 10

I have need to store large square matrices in memory, some times sparse, some times not. I have used up to $2^{15}$ by $2^{15}$ as my upper bound so far, and Mathematica has handled it even if it took ...
1
vote
1answer
49 views

Defining a matrix with the symmetry Transpose[A(q)]=A(-q)

I am trying to construct a symbolic matrix with the following property- $$ \left(D_{3\times3}(q)\right)^T = D_{3\times3}(-q) $$ Note that for $q\in \mathbb{R}$, $D(q)$ would be hermitian. So far i ...
1
vote
1answer
80 views

Getting a part of a matrix Inverse for later use

I was trying to get an element of a matrix, and use in further computation of my program. Problem was that its not reading the value unless and until I specify it again. My code is: ...
1
vote
2answers
67 views

Insert an element to AdjacencyGraph

I'm not able to insert an element to mine AdjacencyGraph. I suppose that i should modify my AdjcencyMatrix: ...
0
votes
1answer
59 views
4
votes
3answers
208 views

How can I suppress zero or nonzero values in a matrix?

So, if I have something like: F[IdentityMatrix[3] // MatrixForm, 1] I'd like F[] to display: $$\begin{pmatrix} 1 & ...
5
votes
4answers
242 views

Replacing parts of a matrix

I'm a beginner to Mathematica and to writing scripts in general. I'm currently trying to write a code that will take any element in a matrix higher than a certain threshold value n and set it equal to ...
1
vote
0answers
119 views

I need some GPU benchmark for Mathematica

I am considering to buy a GPU. I need to know two things: Is it possible to solve a system of differential equations using GPU and Mathematica's functions? I need to know how much faster would be ...
0
votes
0answers
21 views

'MatrixForm' problem [duplicate]

I prefer to use 'MatrixForm' because the form looks better in matrix manipulation. But my current problem is that after the use of 'MatrixForm', subsequent matrix calculations like 'Det' or 'Inverse' ...
3
votes
1answer
137 views

Calculate efficiently an expensive hermitian matrix

I want to compute a matrix $M_{pq}$, for which the calculation of each coefficients $M_{pq} = f(p,q)$ is an expensive function. I know that my matrix is hermitian, so that $M_{qp} = M_{pq}^{*}$. As a ...
0
votes
0answers
98 views

How to speed up my code with constructing matrices

I have run this program for a long time to get the result for n = 2048(about 5hours) and no more result till now (can't run with n = 4096). I would know how to make it more efficient. Any help or ...
4
votes
2answers
162 views

Finding the Position of the Minimum Neighbor for Each Element in a Large Matrix

I have a large matrix ($6020\times 8452$), and I want to create a new matrix where the relative position of the minimum neighbor is each element in the matrix. For example, if I had the matrix ...
3
votes
1answer
96 views

Making table of matrix product and efficiency

I want to make a table in which each element is a matrix product: ...
3
votes
1answer
156 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.
1
vote
1answer
58 views

Computation time depends on the matrix elements!

Consider these two lists of matrices, matrix and matrix2: ...
15
votes
2answers
395 views

Why is my data 10 times slower than random data when doing matrix multiplication

I have some data generated from some program, and it appears that matrix multiplication on these data are about 10 times slower than on some random data: ...
1
vote
1answer
81 views

Efficient method of raising matrix to a variable power?

I have a $2 \times 2$ matrix $A$, where each element is a 12th order polynomial in a parameter $a$. I need to raise this matrix $A$ to the $-t/T$ power, where $T$ is a known scalar (for this ...
2
votes
2answers
101 views

specified matrix query

can you tell me a way (best?) to get a matrix with i=N,j=N dimensions (quadratic) according to the following rules: variables: N , M, n the diagonal must contain zeros it must contain exactly M ...
4
votes
1answer
181 views

Table and memory efficiency

Consider these two types of creating matrices: Table[Table[i*j,{i,1,10}],{j,1,10}] Table[i*j,{i,1,10},{j,1,10}] I want to know if there is any difference ...
4
votes
1answer
156 views

Fast matrix multiplication in MMA and GPU

Matlab multiplies two 3000by3000 matrix around 0.18s faster than MMA. While for just a few matrix multiplications the speed difference is not important, it becomes crucial when I want to do those ...
0
votes
1answer
223 views

How to take transpose of a one dimensional vector? [closed]

Why the two followings giving me same output? At least one should give me a row vector and another should give me a column vector. MatrixForm[u = {1 , 1, -1, 1}] MatrixForm[v = {{1}, {1}, {-1}, ...
5
votes
3answers
263 views

Multiplying block matrices

I have a 2*8 matrix A, and a 2*8*2 matrix B. So B[[1]] and B[[2]] are both 8*2 matrices. I need a neat way to multiply A by B so that the first list in the result is A.B[[1]] and the second list ...
2
votes
1answer
87 views

Rescaling and reorienting Matrix Plot axes

I have implemented a numeric Laplace Solver in C++ and am trying to graphically represent the validity of my method. I have outputted the grid from C++ and imported it into Mathematica to get the ...
0
votes
2answers
93 views

Obtaining the relations of variables using diagonal matrices

I know this is too an elementary question, but I am a pathetic newbie in mathematica and I cannot find any answer by googling. What I want is obtaining some relations of unknown variables using their ...
3
votes
1answer
94 views

Print array with indices

Is there a single function that prints an array together with the indices? I know how to achieve this with Grid[{Range[n],array},Frame->All], but I vaguely ...
0
votes
0answers
74 views

solving singular matrix [duplicate]

Hello I have a matrix that is singular, and i wanted to use linear solve to solve it but that doesn't work with mathematica. The matrix given as a list looks like this: ...
0
votes
0answers
37 views

parsed matrix not deleting elements in adjusted matrix

I have a matrix that has been parsed to delete certain rows and columns, as well as delete certain elements on the diagonal on the matrix. The problem is that it does this in theory when i take the ...
0
votes
1answer
85 views

Matrix form of complex numbers [closed]

Complex numbers have matrix form. But some 2x2 matrices while differ, represent the same complex number. To compare complex numbers one has to transform the matrices to the form \begin{pmatrix} a ...
2
votes
1answer
92 views

Design matrix rank does not match

I'm attempting to fit a linear model and Mathematica returns the error message: "The rank of the design matrix 9 is less than the number of terms 10 in the model. The model and results based upon it ...
3
votes
2answers
90 views

How to reflect the entries of a square matrix about its anti-diagonal?

I need help with writing the mathematica code to reflect the entries of a square matrix about its anti-diagonal. I know to do it about the main diagonal using ...
0
votes
1answer
55 views

Why is there a seeming discrepancy with the expression Cofactor?

I was trying to find out the cofactors of a square matrix. Then I came across the command Cofactor in Combinatorica package. ...
2
votes
1answer
125 views

Computing with matrix differential operators

I am looking the achieve a working set of Mathematica functions that would allow me to take products, commutators, etc. of (2x2) matrix differential operators and apply them to vector-valued functions ...
0
votes
0answers
71 views

How to assign equation solutions to variables [duplicate]

I have 12x12 Matrix with which I have to solve the equation below: ...
3
votes
2answers
106 views

Help with building matrices

I am a complete beginner in Mathematica and I have a small problem. I have this three matrices (A,B and C) and with them I have to build larger matrix M which looks like this. What would be the ...
1
vote
0answers
96 views

Fast export of large numerical data

Edit It seems that the bottelneck is not due to eigen value problem. I will esit the question soon. I have a 6000by6000 matrix which I got after some calculations. I want to get the eigenvalues and ...
1
vote
2answers
70 views

how to get continuation of square matrices with periodic diagonal band automatically?

I want write a function that can automatically analyze any square matrices with periodic band diagonals and give continuations of them. But I can't figure out an elegant way to do this. Suppose we ...
2
votes
1answer
64 views

Anyone knows the algorithm used by NullSpace function?

NullSpace function gives a list of vectors that forms a basis for the null space of the input matrix. When the rank of the input argument matrix $M_{m\times n}$ is ...
2
votes
3answers
182 views

How to find the kth largest eigenvalue of a matrix, taking into account the sign? [duplicate]

I have a real symmetric matrix m (i.e. its eigenvalues are all real). Eigenvalues[m, {k}] will find the ...
1
vote
2answers
168 views

Get inverse of a matrix step-by-step [duplicate]

How can I get the inverse of a matrix step by step? An example: Given the matrix `{{8, 2}, {3, 2}}´, the result is {{$\frac{1}{5}$, -$\frac{1}{5}$}, {-$\frac{3}{10}$, $\frac{4}{5}$}}. But how can I ...
0
votes
1answer
72 views

How to add an extra column to a current matrix (list)? [duplicate]

a = {{-800, 1712}, {-801, 1713}, {-806, 1832}} TableForm[a] b = a[[All, 2]] - Min[a[[All, 2]]] How do I make a new matrix (list) whic looks like this ...
1
vote
1answer
104 views

Correlation to Covariance Matrix

I am looking to use the CopulaDistribution fucntion, with a "MultiNormal" kernal. However, for the input, O require a covariance matrix. However, I only have a correlation matrix. Is there a way to ...
1
vote
2answers
60 views

Table operation after export and import of data does not give me the same result

If I create a table of this kind: (m1 = Table[{RandomInteger[], RandomInteger[{1, 5}, {3}]}, {i, 1, 5}]) // MatrixForm which looks like I know how to pick ...
3
votes
2answers
108 views

Eigenvectors of large symbolic matrix

I have large symbolic matrix of order 32 x 32 given as ...
1
vote
0answers
124 views

Best way to create symmetric matrices with block structure and additional symmetries of the submatrices

Update: you can now skip the "My attempted solution" part and jump to "My first attempt for improvement" in the end of the question. My question is related to Best way to create symmetric matrices . ...