Questions on the manipulation of matrices in Mathematica.

learn more… | top users | synonyms (1)

-2
votes
1answer
79 views

Recreating in Mathematica a matrix created in Python [closed]

I need to recreate in Mathematica this matrix that I created in Python: ...
0
votes
1answer
55 views

Plotting six chosen rows of a matrix

I have a matrix,W, whose dimension is n x n, each entry is a number. I need to plot only the values of six rows, namely those ...
0
votes
1answer
73 views

Calculating a function repetitively without using a For loop

In my programme I have defined all these functions: ...
1
vote
2answers
95 views

Filing matrix by bands [closed]

I need to fill a matrix, CSI, by taking elements from an array, inverse, which is the Inverse Fast Fourier Transform of an array ...
2
votes
1answer
59 views

sparse array with list [closed]

i'm trying to populate a sparse array with lists in certain positions, i tried the following code, ...
4
votes
4answers
706 views

Writing a circular matrix

I have two square matrices, $A$ and $B$, of the same size, say, of $m \times m$. What I want is to write a programme/function of three variables, $A$, $B$ and $n$, that outputs the $mn \times mn$ ...
1
vote
2answers
54 views

How can I manipulate this list?

I performed a loop with Table where I solve a system of 4 equations that depends on two parameters: eta and p. I create two lists for each parameter as follows: ...
1
vote
1answer
68 views

Defining a function of matrices [closed]

I am translating my code from Python to Mathematica. How can I define a function similar to the following: ...
0
votes
3answers
79 views

Define a matrix depending on variable in Mathematica [closed]

I am translating my code from Python to Mathematica. I am trying to define a matrix, whose values depend on a variable chosen by the user, called kappa. In Python the code looked like that: ...
1
vote
4answers
102 views

calculating subsets of a matrix (L=40X40)

I need to calculate all $k$-possible subsets$(k:1,L)$ of matrix with size $L$. I am using subset function as following, ...
2
votes
1answer
98 views

How do I generate all $n\times m$ matrices s.t. $a_{i,j} \in {a … b}$?

Is there a fast and clean way of generating all possible $n\times m$ matrices s.t. $a_{i,j} \in \{a ... b\}$ - much like Range does in $N$? Consider for example that for $n,m = 2$, $a=0$, $b=2$ I ...
0
votes
1answer
58 views

What is the “proper” way of multiplying a list of vectors by a matrix? Why Map does not work? [closed]

I am an absolute newbie with Mathematica, so please forgive me if this is stupid, but for the life of me I can't solve this. Suppose I have a list of vectors $b_{1...n}$ and a square matrix $A$ and I ...
4
votes
3answers
136 views

Unragging a matrix

Today I ran into matrices like this one: ...
0
votes
0answers
40 views

How to add a positive definiteness of a unsymmetric matrix as a constraint to a Findminimum problem

The problem is I have a function which has 33 variables, and which to minimize it in a given set of contraints. I have also a matrix consisting of these 33 variables. The condition is that this matrix ...
0
votes
0answers
9 views

Add positive definite matrix constraint to an optimization problem [duplicate]

The problem is I have a function which has 33 variables, and which to minimize it in a given set of contraints. I have also a matrix consisting of these 33 variables. The condition is that this matrix ...
0
votes
1answer
55 views

Maximum element and its position (row,column) of matrix

Can someone help me to get the maximum element of $m\times n$ matrix and corresponding row and column $(i,j)$?
2
votes
3answers
136 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
62 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
54 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
148 views

Creating a matrix under conditions

I would like to create a matrix whose elements satisfy the following conditions ( Mathematica 9 ) ...
2
votes
1answer
123 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
43 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
157 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
76 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
52 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
29 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
76 views

Finite Field matrix rank calculation

How does one define a matrix over $\mathrm{GF}(p^r)$ in Mathematica in order to compute rank? I am working with $\mathrm{GF}(2)$?
1
vote
1answer
71 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 ...
5
votes
3answers
418 views

Complex conjugate

How do I complex conjugate a vector? ...
0
votes
1answer
104 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
59 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
35 views

A problem about NIntegrate the smaller eigenvalue for a matrix

Define a matrix and a function as ...
1
vote
1answer
116 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
85 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
160 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
76 views

Matrix operation (simplify)

I had a $6\times 6$ matrix ...
2
votes
1answer
95 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: ...
1
vote
1answer
66 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
62 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
61 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 ...
1
vote
0answers
65 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
272 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
237 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
102 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
69 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
156 views

Diagonal minors of matrix

I need to calculate the minor of a matrix. I am going to use Mathematica example here, ...