Questions on the manipulation of matrices in Mathematica.

learn more… | top users | synonyms (1)

6
votes
1answer
215 views

Is matrix multiplication automatically done in parallel in Mathematica 9?

In good old Mathematica versions (5.2, 6.0), matrix multiplication was automatically done in parallel. For example, on an 8-core machine, define two square real matrices: ...
13
votes
1answer
240 views

Unpacked eigenvectors of complex matrices

I want to calculate eigenvectors of a Hermitian matrix. For example ...
7
votes
1answer
218 views

Limit for Matrix expression

Let's assume that $Q_0$ is $3\times 3$ matrix with $\det Q_0\neq0 $ and $$ Q_{i+1} = \frac{1}{2}\left[ Q_i+(Q_i^{-1})^T \right] $$ I need to find next limit: $\lim _{i \to +\infty}$$Q_i$. In other ...
0
votes
1answer
62 views

Issues FindRootPlot command

I've had some fun playing around with FindRootPlot for a simple system of equations: ...
2
votes
1answer
156 views

How to create a SparseArray satisfying multiple conditions on Parts and Elements of a Matrix?

I have a matrix m1 of size $3 \times 19$. Rows $1$, $2$ and $3$ represent $3$ different groups, and columns represent $4$ different blocks: block1 - columns $1$, ...
4
votes
2answers
147 views

Permutations: selecting reviewers without conflicts of interest

I would like to automate the process of selecting a number of proposal reviewers that fit a conflict of interest criterion. Let's say I have 5 reviewers and 5 applicants from 5 departments. The ...
5
votes
5answers
280 views

What is the fastest way to replace all zeros in a matrix?

In the following matrix m every 0 should be replaced with a 1: m = {{0,1,2},{5,0,3},{8,0,0}} Desired result: ...
5
votes
2answers
205 views

Random Matrix with integer coefficients and inverse also having integer coefficients

I'm trying to build a function that gives me matrices such that each: Has integer coefficients. Is non singular. Has inverse which also has integer coefficients. I have some code that one of my ...
0
votes
0answers
98 views

Getting increased accuracy for roots of determinant

I have a matrix $a(\kappa)$ from which I am trying to determine $\kappa$ by using the equation $det(a(\kappa)) = 0$. The matrices I deal with are on the order of 100 X 100 to 500 X 500. Originally I ...
1
vote
2answers
193 views

Finding maximal sublist of linearly independent vectors

Given a list of vectors v = {v1, ..., vn}, which is the fastest way to find a maximal sublist of linearly independent vectors? I could add the vectors one by one to ...
3
votes
2answers
131 views

Write list of polynomials as a matrix of coefficients times a list of monomials

I have the following problem: given a list of polynomials P = {p1, ..., pn} on the variables x[1], ..., x[n], find a list of ...
0
votes
2answers
133 views

Deleting duplicates from matrix

I have a 4x4 symmetric matrix that is obtained by solving some equations. I tried deleting duplicates with DeleteDuplicates, but that's not working with nested ...
3
votes
2answers
180 views

Mixed product identity between tensors in Mathematica 9

How can we simplify tensor expressions in Mathematica 9 using the mixed-product identity $(A\otimes B)(C \otimes D) \equiv AC \otimes BD$ ? Is it possible to implement this kind of evaluations using ...
2
votes
1answer
561 views

How to simplify symbolic matrix multiplication results?

I've defined three symbolic abstract matrices X, M and S as shown below. ...
4
votes
3answers
697 views

Minimum spanning Tree from a weighted adjacency graph

Note: Cross-posted at http://community.wolfram.com/groups/-/m/t/137658?p_p_auth=8QnKtT9I I have a really big graph, 40x40. Here is my code ...
0
votes
0answers
30 views

How to construct matrix by using already-defined matrix? [duplicate]

I'm trying to construct the matrix by using matrices which are already defined. For example, I would like to construct the following matrix 1 0 0 1 And each elements are 2-by-2 matrix like 1 ...
0
votes
0answers
47 views

Is there any way to stop calculation of unimodular matrix in HermiteDecomposition

I want to calculate Hermite normal form of a matrix. But I do not want the unimodular transformation matrix. Is there any way to stop the calculation of unimodular matrix? HermiteDecomposition ...
0
votes
2answers
435 views

Classification of a linear system of equations with a parameter

I need to get every possible value of k that returns infinite number of solutions or no solution to this system: ...
2
votes
2answers
94 views

Keep order of mulciplication in Matrix production

{{λ E, B}, {λ A1, λ E}}.{{E, 0}, {-A1, E}} \begin{align*}\left(\begin{array}{cc} E^2 \lambda -A1 B & B E \\ 0 & E^2 \lambda ...
1
vote
1answer
238 views

Row-Reduced-Echelon-Form with Equation Parameters for Consistent Systems

I often do row-reduced-echelon-form (RREF) calculations that involve parameters using the RowReduce command. Most times, I want to know which parameters make the system consistent. For example: ...
6
votes
1answer
569 views

Fastest way to do vector / matrix multiplication with constant matrix

Suppose we have a fixed n x n matrix, call it $B$. What is fastest way to evaluate $v^t B\;v$ over many different vectors $v$? Since $B$ is a constant matrix, does this allow the number of operations ...
3
votes
1answer
74 views

quadratic constraint feasibility

Suppose that $A$ is an $n \times n$ matrix, and I have observed some entries of $A$, say, $A_S$ ($A$ restricted on $S$) for some subset $S$ in $\{1,...,n\} \times \{1,...,n\}$. I want to know if it's ...
2
votes
3answers
127 views

Any way to reverse span and join two span in Mathematica?

I port a matlab code to mathematica. In the original matlab code, I use ":" to pick up the desired elements in a matrix. In mathematica, I find in the documentation that the span operator is ";;" ...
7
votes
1answer
343 views

Extract matrix from a system of linear equations [duplicate]

I have a big system of linear equations $f_i(x_1,...x_n)$ with $n$ variables and $n$ equations. I want to extract the matrix $M$ where $\vec{f}(\vec{x})=M\vec{x}$. For example if I have $$ f_1(x) = x ...
1
vote
1answer
456 views

Direct sum of matrices [duplicate]

Is there a simple way (perhaps even a built-in function) that allows one to compute the direct sum of two square matrices?
0
votes
0answers
44 views

Eigenvalues of a matrix, rhombus/hash sign [duplicate]

I wanted calculate the eigenvalues of A = {{0, 1, 0, 0}, {a, b, c, 0}, {0, 0, 0, 1}, {d, 0, e, f}} Then assigned the parameters a value ...
0
votes
0answers
50 views

Construct matrix B from columns of matrix A? [duplicate]

Starting with Mathematica and working with matrices, I am looking for a way to construct a new matrix B from columns of matrix A. For example, matrix a has 8 columns and 4 rows, I want matrix B to be ...
0
votes
1answer
138 views

johansen test error in code

Cross-posted at the Wolfram community forum I have found this code on a forum, apparently it worked in a previous version of mathematica. Now when I run it, it keeps running for ages. I am not able ...
1
vote
1answer
83 views

Matrix generation

I have a $2x2$ matrix $M$. $M$ has the following form: M = {{a, bExp[-2ikz]}, {bExp[2ikz], a}} $a, b, k - const.$ z is ...
7
votes
5answers
185 views

Selecting terms from a matrix

There are similar questions to this on the forum but none fit the purpose here: I would like to extract certain elements of a matrix depending on whether a factor is present or not, and create ...
2
votes
1answer
187 views

Plotting a matrix in 3D With specific ticks [duplicate]

I have matrix and I want to plot it in 3D ...
0
votes
0answers
117 views

How does Mathematica solve eigenvalues?

I believe mathematica uses some techniques beyond our book. According to the text book it is not possible to solve eigenvalues of which the matrix has not completely eigenvectors, or of those matrix ...
0
votes
1answer
182 views

Quickly sum over vector outer products

I am trying to do a simple summation over outer products. I wrote the code as straightforwardly as I could, but perhaps there is a more efficient way to do it. ...
4
votes
2answers
151 views

Assumptions for RotationMatrix

I'm making C++ program, and in my program I need a rotation matrix around any vector. I wanted to extract RotationMatrix[fi,{x,y,z}] output and put it in my ...
0
votes
2answers
196 views

Apply a function to a matrix of vectors [closed]

I have a matrix containing on each position a pair of numbers $(a,b)$. I would like to compute the norm of each vector $(a,b)$ and keep the result in form of a matrix. So basically, I need to apply ...
0
votes
1answer
95 views

Parallelize matrix operations

I'm trying to reduce to a minimum the time of some matrix operations. When I don't parallelize and write the code in the most compact form I get the operation done in around 1sec (is this good? the ...
2
votes
1answer
110 views

DirectAgglomerate not working for Large Matrices

I am trying to graphically display a distance matrix with similar elements visually clustered into groups. My original matrix has the elements in a random order so the first thing I do is to change ...
0
votes
0answers
86 views

Matrices and Upper / Lower Triangular Factorizations

Does anyone know (I have searched documentation, online and MathSource) if there are ways to coax out the following factorizations from Mathematica? $A = LU$, $LU$ factorization $PA = LU$, $LU$ ...
2
votes
2answers
224 views

Is there a way to parallelize the convolution component of EdgeDetect?

Provided an image like - test = Import["http://upload.wikimedia.org/wikipedia/commons/d/d5/Sunflowers.jpg"] We can run ...
14
votes
6answers
685 views

How to find the distance of two lists?

I have two lists as the followings: ab = {1, -1, -1, -1, 1, 1}; ac = {1, -1, -1, 1, 1, 1}; How I can find the difference (more precisely, the edit distance) ...
5
votes
2answers
258 views

Faster Eigenvalues with lower precision goal

I compute all eigenvalues of a large matrix, and I decide that the speed is more important than the precision. Then the question is, can I speed up Eigenvalues[] by ...
1
vote
1answer
87 views

Collect the multiple of one determinant?

m = {{2, 6, 4}, {2, 6, 5}, {-3, 6, 6}}; Consider I'm doing calculation by hand. I want to collect the multiple 6 of second column, how to do that? I'd like the ...
1
vote
0answers
34 views

How to divide all rows of a matrix by their row sums [duplicate]

I've got a general matrix K that I would like to divide it's row's by the row sums of the matrix. I could get this going by doing ...
5
votes
2answers
354 views

How to combine elements of two matrices?

Given two matrices m1 and m2, e.g.: m1 = {{a1, b1}, {c1, d1}} m2 = {{a2, b2}, {c2, d2}} How can one obtain the following? ...
3
votes
1answer
292 views

How can I get Mathematica to recognize equality of symbolic matrix expressions?

I have two matrix expressions: X.Transpose[T].Transpose[X] and X.T.Transpose[X] I want Mathematica to recognize that ...
0
votes
1answer
115 views

Trouble carrying out symbolic operations on matrixes

I have some problems. First of all, I declare matrices like below ...
4
votes
1answer
267 views

How to construct this matrix fast?

I write a function which is a matrix as below: ...
4
votes
1answer
290 views

Matrix Rational Canonical Form

Is there a way to calculate the Rational Canonical Form of an $n\times n$ integer matrix using Mathematica? I have been perusing the documentation and web, but nothing so far.
7
votes
2answers
399 views

Is there any fast way to solve a quadratic matrix equation in Mathematica approximately?

Let the square nonsingular matrix $M$ is a given convergent matrix. What are the best scalar values for $\alpha$ and $\beta$ (in the real numbers domain), at which the following quadratic matrix ...
4
votes
2answers
173 views

Using two color functions in a MatrixPlot

I'm trying to use two color functions within one MatrixPlot in Mathematica. Is it possible to do this? For example, using a very simple matrix: ...