Questions on the manipulation of matrices in Mathematica.

learn more… | top users | synonyms (1)

4
votes
1answer
130 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
44 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
49 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: ...
0
votes
0answers
20 views

Maintain a function quality of an expression [on hold]

I have written a simple code in Mathematica to put a matrix into a vector. The matrix was a function of a variable n, and I want the new vector to also have this quality as a function of n. ...
1
vote
2answers
56 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
58 views
0
votes
0answers
40 views

Transform Excel .xlsx file into a matrix [closed]

i have a table in excel which represents a 45x45 matrix. I have a WolframAlpha Pro Account and wanted to do some calculations on the matrix. Is there any way that wolframAlpha interprets the xlsx file ...
4
votes
3answers
198 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
231 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
58 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
20 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
132 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
96 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
143 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
88 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
111 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
54 views

Computation time depends on the matrix elements!

Consider these two lists of matrices, matrix and matrix2: ...
15
votes
2answers
374 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
65 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
98 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
165 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 ...
3
votes
1answer
109 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
97 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
240 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
64 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
90 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
86 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
59 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
36 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
77 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
79 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
68 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
40 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
98 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
50 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
104 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
73 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
66 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
63 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
145 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
107 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}$}, ...
0
votes
1answer
62 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
77 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
56 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
106 views

Eigenvectors of large symbolic matrix

I have large symbolic matrix of order 32 x 32 given as ...
1
vote
0answers
101 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 . ...
0
votes
1answer
60 views

How to use Hold on a variable defined as a graph

I'm working on doing operations on different graphs and getting their probability node degree distributions using a simple algorithm. If I have many defined graphs, for example: ...
2
votes
2answers
44 views

Findings rows in RREF matrix which contain nothing but a pivot

I am asked to find all rows in a matrix in reduced row echelon form which contain nothing but pivots (pivot is $1$, all other entries are $0$). For example, in this matrix: $$ \begin{bmatrix} 1 ...
1
vote
0answers
43 views

Dealing with answers that have Root[ …] when finding an Eigensystem

This is a 3x3 matrix and I think it should solve for the expressions in terms of radicals. I am not sure what to do with this.
-2
votes
1answer
54 views

Create a matrix by crossing a list

I've a list L of elements. I want to create a matrix by laying each elements of L in both rows and columns where each ...