Questions on the manipulation of matrices in Mathematica.

learn more… | top users | synonyms (1)

0
votes
0answers
12 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. ...
1
vote
1answer
30 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: ...
3
votes
3answers
126 views

Creating a matrix under conditions

I would like to create a matrix whose elements satisfy the following conditions ( Mathematica 9 ) ...
-3
votes
0answers
29 views

Get function creating variables inside [on hold]

I want to use Mathematica to create this function in pseudocode: ...
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.
2
votes
1answer
89 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 & ...
0
votes
2answers
35 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: ...
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
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
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
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
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 ...
0
votes
1answer
35 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)$?
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 ...
4
votes
3answers
258 views

Complex conjugate

How do I complex conjugate a vector? ...
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 ...
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

A problem about NIntegrate the smaller eigenvalue for a matrix

Define a matrix and a function as ...
1
vote
1answer
90 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 ...
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 ...
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: ...
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$ ...
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
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 ...
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, ...
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 ...
0
votes
1answer
46 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 ...
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 ...
2
votes
1answer
104 views

Force Mathematica to return numerical answer to (relatively) complicated differential function

I am trying to take the Laplacian of the LogDet of a 2x2 matrix that I call V\[ConjugateTranspose].V, and actually get a number out at the end. Why does Mathematica ...
0
votes
1answer
49 views

How to plot first and second row from matrix to a graph

i have this function: ...
0
votes
0answers
20 views

Manipulating nested matrices columnwise [duplicate]

I have a project that requires analyzing large volumes of excel sheets at the same time. I have been having trouble figuring out how to index the imported files and manipulating them. The way I am ...
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} ...
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 ...
1
vote
0answers
61 views

How to find Pauli matrices

I wanted to find the Pauli matrices, so i wrote down this code: z = {{a, b}, {c, d}} i = {{1, 0}, {0, 1}} Solve[z.z == i, {a, b, c, d}] and mathematica gave me ...
0
votes
1answer
32 views

Reduce Vector/Matrix mod N [closed]

If I have a vector such as below and want to reduce it mod a number, how can I do this? V = {{176}, {648}}; MatrixForm[V] MatrixForm[V, Modulus -> 26] Both ...
0
votes
0answers
111 views

Solving Symbolically Equations with Vectors and Matrices

I want to solve equations with vector variables and vector/matrix parameters symbolically. As a basic example I would like to be able to solve something like $[I-aG]x=b$ where $a,b \in \mathbb{R}^l$ ...
5
votes
4answers
498 views

Elegant mehod of generating this matrix?

Good evening, I need to determine an elegant (as possible) method of computing an nxn matrix below (the matrix shown is just a 16x16 example). I've been toying with For loops, Tables, Bands, ...
0
votes
1answer
205 views

Code efficiency improvement needed solving problem 499 in Project Euler

I am trying to solve https://projecteuler.net/problem=499 by constructing a transition matrix and finding its steady state. Here is my code: ...
1
vote
1answer
74 views

How to paste matrix to website and Email?

I tried to copy matrix from Mathematica to website, only end up with lots of garabge like this: ...
2
votes
2answers
53 views

How to edit a list according to the other list? [duplicate]

Gday guys. This problem troubles me, and I hope you can help me solve it. Say I have two random lists L1={{2},{5},{1},{0},{4},{7},{8}} L2={2,5,1,0,4,7,8} and ...