Questions on the manipulation of matrices in Mathematica.

learn more… | top users | synonyms (1)

0
votes
0answers
87 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 ...
3
votes
2answers
117 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
113 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 ...
2
votes
1answer
443 views

How to simplify symbolic matrix multiplication results?

I've defined three symbolic abstract matrices X, M and S as shown below. ...
0
votes
2answers
398 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: ...
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
42 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 ...
2
votes
2answers
83 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
192 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
488 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
73 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
114 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
3answers
695 views

Why don't * and ^ work as I expected on matrices?

For example, this input... {{1, 2}, {3, 4}}*{{1, 2}, {3, 4}} produces this output... {{1, 4}, {9, 16}} and this input... ...
1
vote
2answers
360 views

How to find the position of non consecutive numbers?

Given a sorted table, how can I find the position of non consecutive numbers in the first column of the table? ...
6
votes
1answer
232 views

Extract matrix from a system of linear equations

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 ...
7
votes
2answers
1k views

Badly conditioned matrix (General::luc)

With some matrices I am receiving the following message ...
0
votes
1answer
326 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
1answer
118 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 ...
0
votes
0answers
48 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 ...
1
vote
1answer
77 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
169 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
135 views

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

I have matrix and I want to plot it in 3D ...
0
votes
0answers
110 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 ...
1
vote
1answer
133 views

Construct an infinte matrix with finite sub-matrices

How can I construct an infinite matrix with finite sub-matrices of the form A = (B0, 0, B1 0, B2, 0 0, 0, B3) where each Bi is a rectangular or a ...
0
votes
1answer
148 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. ...
0
votes
1answer
83 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 ...
4
votes
2answers
143 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 ...
17
votes
2answers
2k views

How to form a block-diagonal Matrix from a list of matrices?

like this: I know join[...] works, but it is a bit troublesome for multiple matrices.I tried DiagonalMatrix[...], but DiagonalMatrix can only form matrix from a list of elements.
-2
votes
2answers
166 views

Mathematica not assigning variable correctly

So I have been fiddling with this the last hour and I just can't get it to work. I have 3 matrices of the same size which contain nothing but 0's in a list, I also have 3 matrices of the same size ...
2
votes
1answer
90 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
2answers
146 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 ...
1
vote
3answers
211 views

Dynamically filling matrix with a[[n,m]] = 1/a[[m,n]]

I'm building a square matrix, with 1s on the diagonal and elements in U the inverse of elements in L, which are random integers drawn from the sequence 1, ..., 9. Given the nature of the problem I ...
0
votes
0answers
74 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$ ...
5
votes
2answers
190 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 ...
7
votes
2answers
363 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 ...
1
vote
1answer
81 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 ...
4
votes
1answer
260 views

How to construct this matrix fast?

I write a function which is a matrix as below: ...
8
votes
5answers
275 views

correct way to map a function on entries down the pages in a 3D matrix?

updated: added another method to the methods I tried below for completion. This is new way of doing it, but most likely not very efficient, did not time it I can only visualize 3D matrices in my ...
5
votes
2answers
269 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
275 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 ...
1
vote
0answers
32 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 ...
1
vote
2answers
337 views

How do I divide the columns of a matrix by the sum of its elements?

I am trying to create a transition matrix for a network. In order to do this, I need to sum down the column (the out degree), and then divide the column by the out degree in order to normalize it. ...
0
votes
1answer
111 views

Trouble carrying out symbolic operations on matrixes

I have some problems. First of all, I declare matrices like below ...
4
votes
1answer
262 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.
3
votes
3answers
479 views

Can RowReduce work in this matrix?

The matrix $Q$ with dimensions $n\times2*n*m$ is structured by $$Q=[B|AB|\cdots|A^{2*n-1}B]$$ where $Q$ is an augmented matrix built from a $3\times3$ matrix, $A$, and a $3\times2$ matrix, $B$. I ...
4
votes
2answers
161 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: ...
1
vote
2answers
236 views

How do I create matrices with arbitrary list restrictions?

I want to randomly generate a square matrix of dimension n with entries in the list StartingEntries, and also satisfying that for any such matrix M, the matrix Inverse[IdentityMatrix[n] - M] has ...
4
votes
4answers
219 views

Elegant Matrix Combinations

Suppose you have a matrix (mxn), simplified for illustration m= {{a, b, c}, {d, e, f}} And a set of combinations (simplified for illustration purposes but can ...
3
votes
4answers
191 views

Generate Non-Singular Matrix of $n*n$ dimension

I want to create a function that will make an $n*n$ matrix which is non-singular that will always retrieve the same matrix (meaning that the matrix will not be random each time). I tried using the ...