Questions on the manipulation of matrices in Mathematica.

learn more… | top users | synonyms (1)

0
votes
0answers
29 views

Parametrizing a matrix given its trace and norm

I have a problem where I have to generate random matrices with the following properties: ($a$ is a given fixed number) $\mathrm{Tr}\, A=0$ $\mathrm{Tr}(A^\dagger A)=\|A\|_F^2=a$ I was wondering ...
5
votes
4answers
157 views

Counting variable from a list of matrices

I have a list of matrices ...
4
votes
2answers
106 views

Gridding in a Nested Matrix

We have a nested matrix as: nested={{he, {{e, f, g, h}, {s, 0, q, i}, {s, 0, q, j}}}, {ho, {{e, f, g, h}, {0, u, t, i}, {u, t, 0, j}}}} and with the line ...
0
votes
1answer
186 views

Usage of Piecewise/RSolve to solve an equation based on condition

`Function optval(vol, intrate, expn, payoff, strike, Etype, NAS) ReDim S(0 To NAS) ReDim vold(0 To NAS) ReDim Vnew(0 To NAS) ReDim Dummy(0 To NAS, 1 To 3) ds = 2 * strike / NAS dt = 0.9 / vol / ...
0
votes
0answers
49 views

Recursive computation using Piecewise

I am trying to create an array using a series of equations using Piecewise. I am stuck in one of them. I am just putting a simplified version of code as below. I ...
0
votes
0answers
45 views

Why my recursive function is not using elements of table? [on hold]

I am trying to create an array using a series of equations. I am stuck in one of them. I am just putting a simplified version of code as below. I am trying build a table ...
-1
votes
1answer
77 views

Laplace equation

I tried to run this code, but it doesn't work for NDSolve ...
0
votes
0answers
35 views

Deciphering output messages using Solve

I'm trying to solve the following system. The error messages I'm getting suggest that there may not be a solution [my desired result], but I'm not sure if there could be something else going on. The ...
0
votes
0answers
54 views

How to handle substrings of a matrix by a named index

I am using open source code to run stochastic simulations. The output looks like this: ...
1
vote
3answers
90 views

Absolute VectorPlot scaling

I'm trying to visualize the vector components of a rotation matrix with absolute vector lengths. VectorScale help states that When using an explicit sfun, ...
0
votes
0answers
64 views

Matrix iteration failing after second step

I am calculating 11x6 matrix using different logics as in below code. Problem is in Do loop in below code where I have two different criteria to update matrix "fd". I am expecting logic in IF which ...
0
votes
1answer
46 views

Replace element of matrix based on rule which invloves other element of same matrix

I am trying to replace 1s row of matrix d iteratively from right by multiplying last element in 1st row with (1-int*dt) to generate 2nd last element. The replacement continues till I reach the 1st ...
0
votes
0answers
50 views

How to replace a part of array based on certain rules which involves usage of other array

I am trying to replace outermost column of array "fd" in below code. fd is matrix of dimension (nas1,nts) which is initially filled with 1. I want to replace outermost column of fd with result of Max ...
0
votes
0answers
18 views

Applied Linear Algebra | Linear Dependent Matrix [migrated]

My response: Am I correct in my approach? Thank you for your help.
0
votes
0answers
15 views

Applied Linear Algebra | Prove the intersection of two subspaces [migrated]

Question: Determine whether or not any column in the matrix is a linear combination of other columns. Provide a general method for answering the same question for any n x n matrix A. My response: ...
2
votes
1answer
70 views

Abstract iterator in Do

I'm trying to write a module. Its input is a matrix (tensor), the module should return new tensor with increased rank with 1. The new tensor is defined as $$ O \Rightarrow N_{\alpha \beta \ldots ...
1
vote
2answers
68 views

Problem in matrix multiplication

I created a random directed acyclic graph using Mathematica. I need to compute a specific function from its adjacency matrix. ...
2
votes
2answers
163 views

Are there any good mass row/column swapping functions for matrices?

I have the following matrix Keeping the 20 row and 20 column fixed (so the 21st rows and columns because I started at 0)...how do I push each row and column back one spot? I need to push the 0th row ...
1
vote
3answers
203 views

Writing code to update a large matrix?

How can I write a code to update a matrix based on certain rules? I plan on constructing a large matrix, and I cannot submit entries one by one. The rules for the matrix are as followed: $$ ...
4
votes
4answers
109 views

Express block matrix in terms of matrix basis

I'm trying to construct a function that returns the multiplication table of a matrix Lie algebra. Assuming a basis of matrices, my definitions: ...
1
vote
0answers
28 views

How can I get symbolic orthonormal eigenvectors for 3 by 3 hermitian matrix?

Using the following syntax, I can obtain the symbolic eigenvalues and eigenvectors of the following Hermitian matrix (a,b,c,d are all real parameters): ...
0
votes
0answers
35 views

How to change dimensions of a matrix?

I have two sets of data that I'm working with, both of which should be 1024 x 1024 matrices (they're from the same instrument). However, when I go to manipulate them, the dimensions of one are read as ...
-2
votes
1answer
75 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
71 views

Calculating a function repetitively without using a For loop

In my programme I have defined all these functions: ...
1
vote
2answers
94 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 ...
0
votes
0answers
28 views

Translation matrix in sperical coordinates system [migrated]

I'm using WorldWind software to draw segments (polyline) on the globe to materialize an aircraft flightplan. Each point in a flightplan is named waypoint. Waypoints are expressed in geographical ...
2
votes
1answer
55 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
670 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
52 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
76 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
98 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
97 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
52 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
135 views

Unragging a matrix

Today I ran into matrices like this one: ...
0
votes
0answers
39 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
47 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
128 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
58 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
53 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
145 views

Creating a matrix under conditions

I would like to create a matrix whose elements satisfy the following conditions ( Mathematica 9 ) ...
2
votes
1answer
122 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
39 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
154 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
71 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
51 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
28 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 ...