Questions on the manipulation of matrices in Mathematica.

learn more… | top users | synonyms (1)

1
vote
2answers
77 views

How to insert a Matrix into a larger matrix

I have a 4x4 matrix v1 v2 v3 v4 myM={{a1,a2,c1,c2}, v1 {a2,a3,c2,c3}, v2 {c1,c2,d1,d2}, v3 {c2,c3,d2,d3}} v4 And I want to ...
1
vote
1answer
50 views

Counting and updating a subset of matrix

I have an n by n matrix and would like to count the number of sub-matrices that is equal to a given matrix. Here is my code: DWBCL creates a matrix with elements a1, a2 and c2 in it and DWBCH with b1, ...
1
vote
2answers
50 views

Filling a matrix with a list of lists

I have a list of lists with different lengthes: {{a1,a2},{b1,b2},{c1,c2,c3},...} Now I want to create a matrix the following way: ...
0
votes
1answer
48 views

Elements inside arrays seem to be strings rather than signed numbers

When I have code like b = Array[Subscript[be, #] &, {3, 1}] b = b /. {Subscript[be, k_] :> Subscript[-be, k] /; k > 1} I am noticing that Mathematica ...
3
votes
3answers
130 views

Creating a matrix under conditions

I would like to create a matrix whose elements satisfy the following conditions ( Mathematica 9 ) ...
1
vote
1answer
58 views

Optimizing matrix inequalities over trace

I need to solve the following problem. Given $n \times n$ Hermitian matrices $A\geq 0$ and $B_1, ~ B_2$ (need not be positive semidefinite), with $Tr(AB_1)<0~,Tr(AB_2)<0$ construct a ...
2
votes
1answer
95 views

Proving positive definiteness or semi-definiteness of a matrix

I have the following 4x4 real symmetric matrix: $K=\begin{bmatrix}3-3w & -\frac{4}{3}+a+2w & \frac{5}{12}+b-\frac{w}{2} & 0\\ -\frac{4}{3}+a+2w & -1-6a-3x & ...
26
votes
2answers
628 views

eigenvector bug?

Bug introduced in 7.0.1 or earlier and fixed in 10.0.0 I have a fairly simple $3\times3$ complex matrix, $$ M=\left( \begin{array}{ccc} \frac{7}{2}-\frac{i}{2} & -1+i & \frac{1}{2}+\frac{5 ...
-3
votes
0answers
29 views

Get function creating variables inside [on hold]

I want to use Mathematica to create this function in pseudocode: ...
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: ...
0
votes
0answers
35 views

Topics for master's project using Mathematica [on hold]

I wish to do 1 year project in linear algebra using Mathematica. What are linear algebra topics which can be implemented on Mathematica as part of 1 year graduate level dissertation.
0
votes
2answers
36 views

in the part assignment is not a symbol, create different matrices with a loop

Im trying to assemble new matrices from some previous matrices I have created, but I can´t. What Im trying to do is the following: 1) I have different matrices: ...
0
votes
1answer
72 views

How to obtain a convergent solution iteratively for a linear system of equations

I am working on a problem that requires an iterative procedure to solve a linear system of equations, the system of equations in matrix form is: $$\underbrace{\begin{bmatrix} r_{11} & r_{12} ...
2
votes
1answer
145 views

Is there a bug in MatrixExp in Mathematica v10?

I'm trying to compute MatrixExp[-I t {{0, 1/2, 0, 0, 1/2}, {1/2, 0, 1/2, 0, 0}, {0, 1/2, 0, 1/2, 0}, {0, 0, 1/2, 0, 1/2}, {1/2, 0, 0, 1/2, 0}}] With ver 9 the ...
0
votes
2answers
70 views

Block anti-diagonalize a square matrix?

In Mathematica there is a very convenient function called JordanDecomposition[]. It takes a square matrix A as an argument and ...
0
votes
1answer
31 views

Getting nicer values for eigensystems [closed]

I want to find the eigensystem of the matrix {{0.9, 0.5}, {0.1, 0.5}}. I tried Eigensystem[{{0.9, 0.5}, {0.1, 0.5}}] The ...
0
votes
1answer
42 views

Why Table is not giving me the same sequence for eigenvalues of matrix

Let consider a matrix and evaluate the time dependent eigenvalues M[t_]:={{Sin[t],Cos[t]},{t,t*t}}; e1[t_]:= Eigenvalues[M[t]] Now If I evaluate ...
7
votes
1answer
218 views

Is it possible to implement symbolic sub matrices?

The accepted answer in the following link: http://stackoverflow.com/questions/5708208/symbolic-matrices-in-mathematica-with-unknown-dimensions provides a functionality to create symbolic matrices ...
0
votes
1answer
49 views

How to get rid of # in answer (eigensystem)? [duplicate]

I was trying to find the eigensystem of the following matrix (act as if the second character is in subscript): \begin{pmatrix} 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ ...
0
votes
1answer
83 views

What if do NOT want Mathematica to normalize eigenvectors with Eigenvectors[N[matrix]]?

ORIGINAL QUESTION Question speaks for itself. Mathematica normalizes the eigenvectors automatically when you type Eigenvectors[N[matrix]]. What if I do NOT want ...
0
votes
1answer
36 views

Finite Field matrix rank calculation

How does one define a matrix over $GF(p^r)$ in mathematica in order to compute rank? I am working with $GF(2)$?
0
votes
0answers
26 views

How to tweak a symbolic RowReduce?

B = {{-1, 1, 0, a}, {-1, 1, 0, a}, {-1, 1, 0, b}}; MatrixForm[B] RowReduce[B] // MatrixForm Mathematica is indeed giving ...
4
votes
3answers
262 views

Complex conjugate

How do I complex conjugate a vector? ...
2
votes
1answer
54 views

Inverting matrix with assumptions

I want to invert a matrix that contains some variables, so I thought I should give some assumptions to Mathematica to speed up the process. How do I assume that $s0,...,s8$ are positive constants ...
0
votes
0answers
31 views
1
vote
1answer
91 views

Why can't Mathematica compute the null space of these matrices?

I'm writing a library of functions to work with musical pitch-class vectors. One of my functions gives me a skew-symmetric matrix modulo 12 that corresponds to the differences between components of ...
1
vote
3answers
282 views

How to do equality check of a large matrix and get the corresponding index position?

Say I have a matrix A = 1000 x 5, and I want to compare it's first element (uppermost top left) to each of the 5 elements in the first column of matrix B of size 5 x 5. Whenever the first time the ...
0
votes
2answers
79 views

Calculating eigenvalues of a large matrix takes a long time

I have a tridiagonal matrix (1000×1000) with each element equal to "one" except {n,n}=2`. It takes 8 hours to give me the eigenvalues?!!. Here, the code I used: ...
1
vote
2answers
150 views

Manipulating elements of a matrix, to loop or not ?

I have a grid of values generated from a MATLAB evaluation. Most of these elements are 0, some 0.5 and the remainder 1. I'd like to write a mathematica script which reads in the CSV and then, in every ...
2
votes
2answers
99 views

Diagonal minors of matrix

I need to calculate the minor of a matrix. I am going to use Mathematica example here, ...
0
votes
2answers
71 views

Matrix operation (simplify)

I had a $6\times 6$ matrix ...
2
votes
1answer
72 views

Stochastic Predator-Prey model using Gillespie's SSA

I'm trying to model the predator-prey situation using SSA. I am very new to Mathematica so my handling of matrices is probably terrible, and that's probably adding to my confusion: ...
3
votes
4answers
170 views

Restricting Numbers in a Matrix

I am generating a random N x N matrix, but with a certain restriction. What I'm trying to do is that when there's a "1" in a position, all neighboring positions must turn to "0" (so if [i,j] = 1, then ...
0
votes
1answer
30 views

Assigning some results after a solve procedure to the coefficients of a matrix

I have a matrix M[3,3]. After a solve procedure, I obtained these results. {{M[1, 2] -> Cos[ψ[t]], M[1, 3] -> 0, M[2, 3] -> 0, Cos[θ[t]] -> M[3, 1], M[3, 2] -> 0, M[3, 3] -> 1, M[2, 1] -> ...
0
votes
0answers
47 views

Calculating the rank of an abstract matrix

I'm trying to compute the rank of a 4x4 matrix with 4 parameters and 2 variables. I tried to calculate its rank under some assumptions on those conditions and I kept getting rank 4. So I did an ...
0
votes
2answers
46 views

Nonlinear matrix equation solving in Mathematica

is it possible to solve below equation in Mathematica? A.X+B.Exp[X]==C A, B are square ...
0
votes
0answers
59 views

Calculate the matrix M such M.X=omega

I would like to determine the matrix M[3,3] such as M.X=w. ...
2
votes
0answers
248 views

How to invert a matrix with 100 trillion elements?

I have a $10^{7}\times 10^{7}$ matrix with the following properties: it is sparse it is gamma-5 it is almost Hermitian. If $M$ is the matrix we are trying to invert, we know $M=A M^{\dagger} A$ ...
8
votes
5answers
902 views

Generating an Ulam spiral

An Ulam Spiral is quite an interesting construction, revealing unexpected features in the distribution of primes. Here is a related topic with one answer by Pinguin Dirk, who has provided one ...
6
votes
3answers
214 views

How to build a matrix from a set of vectors and other matrices using ArrayFlatten

I want to build a 6 by 3 matrix, from the following: one vector is 3 by 1, then a matrix, which is 3 by 2. These will go to the top 3 rows. Now the bottom 3 rows, I'll have 3 vectors each is 3 by 1. ...
1
vote
1answer
279 views

Can mathematica simplify an expression setting simplified answer equal to zero?

Basically I want to reduce something like: Subscript[P, 4] - Subscript[P, 5] == Subscript[R, 4, 5]* Subscript[i, 4, 5] when only one of them is known (...
4
votes
1answer
107 views

Eigensystem on HPC

I am submitting Mathematica jobs to an HPC. I have a large matrix that is a function of (x,y) and I am diagonalizing it for around 500 points in the plane. My initial idea was to request a node with ...
3
votes
3answers
122 views

List manipulation: Dropping first or last row or column of a matrix

How do I drop the first/last row or first/last column from a matrix? The general case is answered here but I am new to Mathematica and it the arbitrary case is unnecessarily complex. Suppose I am ...
1
vote
2answers
93 views

Solving matrix equation

How can I solve the forward equation S[t]=C+A*S[t+1]*(Inverse((I-B*S(t+1)))*A for t=1 to t=10 and ...
1
vote
0answers
63 views

Find algorithm or generator formula with automated procedure and pattern recognition

I am trying to find a generator formula for the discriminant of a polynomial and believe it would be an interesting problem for the Mathematica community to know how to automate evaluation of certain ...
4
votes
3answers
153 views

Replace elements in matrix to make it symmetric using automated procedure

I am generating a matrix using (mat2 = Array[Subscript[a, ##] &, {4, 4}]) // MatrixForm but would like to force Mathematica to make it symmetric. Thereby I ...