Questions on the manipulation of matrices in Mathematica.

learn more… | top users | synonyms (1)

4
votes
1answer
113 views

Efficient Dyson series implementation

I'm trying to implement a Dyson series \begin{array}{lcl} U(x,x_0) & = & 1 + \int_{x_0}^{x}{dy_1V(y_1)}+\int_{x_0}^x{dy_1\int_{x_0}^{y_1}{dy_2V(y_1)V(y_2)}}+\cdots \\ & &{} + ...
2
votes
3answers
178 views

Hypergeometric function with a matrix argument

I am looking for the evaluation of a Hypergeometric function with a matrix argument as for example in Ploev and Edelman or as showcased in this Wikipedia article. From what I understand from ...
0
votes
6answers
200 views

How to build a game board [duplicate]

I have - rather lazily - constructed a chessboard like this: ...
3
votes
2answers
211 views

Order of eigenvectors [duplicate]

I have a matrix A = {{5, 4, 2}, {4, 5, 2}, {2, 2, 2}} The eigenvalues are 1, 1, 10 and I need to find the eigenvectors. ...
1
vote
1answer
66 views

m equations and n variables. Reducing using Mathematica

I have six equations and thirteen variables. I would like to reduce it to seven free parameters. I used Reduce to solve it but it is taking really long (one full day and no output yet) and I think ...
3
votes
2answers
299 views

How to create a 'shortest-path link matrix'?

I am currently struggling with a problem in Mathematica. I have a randomly generated weighted Barabasi-Albert graph and a corresponding demand matrix of the same size. I'm generating the graph with ...
15
votes
1answer
300 views

Unpacked eigenvectors of complex matrices

Edit: This bug is fixed in Mathematica 10.0.0 I want to calculate eigenvectors of a Hermitian matrix. For example ...
0
votes
1answer
174 views

Defining a new matrix product of matrix function [closed]

Suppose I have two matrices A, B, whose entries are functions of x. Suppose they are 2*2. In the product, each entry is of the form $\sum_k A_ik B_kj$. There are two summands corresponding to k=1,k=2. ...
3
votes
3answers
126 views

Solving determinant of a Kronecker product of matrices gives a numerical error - why?

I am doing the following steps (code at the end of the post): I start with a 2x2 matrix (smatrix), which is a function of a single variable (u2). I want to set the determinant of this matrix ...
5
votes
2answers
1k views

How do I keep the right ordering of eigenvalues using Eigensystem?

I'm having an issue with the Eigensystem command. I need to diagonalize a bunch of 3 by 3 complex valued matrices, but more importantly, I need to keep the exact ...
4
votes
3answers
153 views

Split matrix by all-zero columns

Below is my input: mat = {{0, 0, 0, 0, 0, 1}, {1, 0, 0, 1, 0, 1}, {0, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1}, {1, 1, 0, 1, 0, 0}, {0, 0, 0, 1, 0, 1}}; ...
13
votes
4answers
669 views

“Indexing” a vector

I need to "index" a vector according to the first occurence of its distinct elements. I have written ...
2
votes
2answers
108 views

Making a conjecture concerning a certain upper-triangular matrix

I have searched for commands which will let me to create matrices and do matrix operations, but I don't know how to apply Mathematica to the following exercise. Make a conjecture for the result of ...
0
votes
0answers
104 views

Spectral Clustering

I am interested in the following question: How is it possible to check whether an algorithm is working properly? However, this question is too general for the post and I'd like to restrict attention ...
5
votes
3answers
1k views

Matrix Multiplication in context of row and column vectors

I've been looking at some matrices in Mathematica and I've noticed something very weird: They're extremely temperamental when it comes to dot products! For example, if I have the following, ...
1
vote
2answers
90 views

Block diagonal matrix [closed]

Suppose I have 4 matrices: A, B, C, D, and I want to form a block diagonal matrix from these sub-matrices, i.e. it would look like MatrixForm[{{A, B}, {C, D}}] ...
-2
votes
1answer
62 views

Compile Determinant [closed]

I would like to determine the determinant of a 4x4 matrix with the entries a[i,j] being functions of $i$ and $j$. I used Compile with code: ...
4
votes
2answers
189 views

Time-efficient creation of matrix

I have expressions like xx1=FF[1, 1] GG[1, 1] + FF[1, 1] GG[2, 2] + FF[2, 2] GG[2, 2] xx2=2*FF[1, 2] GG[1, 1] + FF[1, 1] GG[1, 2] + FF[2, 2] GG[2, 2] and I want ...
0
votes
1answer
63 views

Matrix consisting of the matrices [duplicate]

I need Dirac Matrix in my work. They consists of PauliMatrix and ZeroMatrix, which is: ZeroMatrix:=IdentityMatrix[2]-IdentityMatrix[2] I define Dirac Matrix as: ...
3
votes
2answers
109 views
8
votes
11answers
1k views

Ragged Diamonds

diamond[n_Integer] := Table[1, {#}] & /@ (Range[n]~ Join~Range[n - 1, 1, -1]) diamond[5] // MatrixForm How could a more functional, "tablefree", solution ...
0
votes
0answers
52 views

Question about the matrix operation [duplicate]

I was wondering if there is an automatic way to do this kind of matrix operation. For example, for a given matrix ...
1
vote
2answers
173 views
3
votes
2answers
127 views

Inserting rows of one matrix into rows of another matrix sequentially

I have two matrices M1 and M2. Both have same number of columns but different number of rows. I want to make a new matrix M which should have 1st row form M1, second row form M2, third row form M1, ...
3
votes
3answers
98 views

Matrix manipulation

Thank you for looking and answering this question. I am trying to create a new matrix from an old one. Meaning, I have a original matrix that's 20x20. I want to keep the first five lines of the ...
-2
votes
1answer
79 views

$SU(4)$ Structure constants in mathematica

How can I write a mathematica function which will output arbitrary structure constants of SU(4)?
1
vote
1answer
79 views

How can I transform a matrix to a vector (vectorization)? [closed]

How can I transform a matrix to a vector in mathematica? $A=\bigg{(}\begin{matrix} a_1 &a_2\\a_3&a_4 \end{matrix}\bigg{)} \longrightarrow |a>>=(\begin{matrix} a_1 ...
10
votes
1answer
181 views

Sporadic bugs in multidimensional SparseArray objects

Udate This SparseArray[] bug is (apparently) fixed on version 10.0 ...
3
votes
3answers
255 views

Matrix containing ellipse

I have to make a matrix which contains elements in an ellipse shaped region, but I need to make ellipse region in such a way that larger axis of ellipse is inclined with angle θ with horizontal. With ...
10
votes
8answers
396 views

Forming an upper triangular matrix from the elements of a list

I asked this question before, but i was closed because it the question was not comprehensible enough. So i reworded it, hope that's ok. I have a list with 6 elements. ...
0
votes
1answer
74 views

Map Elements of a list to be Index of matrix

I have a sublist from Tuples[{1, 2, 3}, 2], say for example L={{1,2},{2,1},{2,2}}, and a 3 x 3 matrix ...
1
vote
2answers
98 views

Display Matrix of values with position [closed]

I want to find the table of values of $x^2 + y^2$ in steps of 1, from $0$ to $5$ for $x$ and $y$, together with the position $(x,y)$: something like this: I can only display the $x^2 + y^2$ value but ...
3
votes
2answers
248 views

Weird behavior when changing parts of matrix

I have this matrix: mat = {{1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}, {11, 12, 13, 14, 15}, {16, 17, 18, 19, 20}, {21, 22, 23, 24, 25}}; and here are its second row ...
6
votes
1answer
6k views

Quick Hessian matrix and gradient calculation?

I am absolutely new to Mathematica and I actually want to try implementing a little optimization method . Long story short assuming I have a predefined two-variable function f(x,y) I want to ...
0
votes
0answers
65 views

how to solve an optimization problem in terms of matrices as the argument

How can I minimize an expression of the form a^T A a where a is a matrix. The following approach does not work if ...
1
vote
3answers
207 views

Finding maximum value with position from Table of values

I have this table of values, how do I find the maximum value? i.e. find $z_{max}(x,y)$ ...
1
vote
2answers
37 views

how to extract a matrix and a vector from a vector [duplicate]

I have a vector like this: V = {a*exp1+b*exp2+c*exp3, a*exp4+b*exp5+c*exp6, a*exp7+b*exp8+c*exp9} and I want to get : ...
1
vote
0answers
146 views

Symbolic matrix calculus: What's new in Version 9

I have seen some of the related posts, which ask about doing matrix calculation on tensors unknown dimensions. One of the posts mentioned that version 9 has some capability, but it was concerned about ...
8
votes
4answers
320 views

Fast method to select matrix elements based on a vector of positions

There is an operation for which I have long wanted to find a better solution. Let: a be a matrix of dimensions $m\times n$ ...
1
vote
1answer
99 views

How to solve an operator form of an integral equation by iteration method?

How I can obtain the $n^{th}$ approximation of the following Operator form integral equation? $F(t)=A(t)+\int_0^tds B(s)F(s)$, where $A(t)=\bigg{(}\begin{matrix}t&0\\Cos(t)&1 ...
4
votes
1answer
133 views

How to input and output partitioned matrices that show partitions and compute as normal?

I want to demonstrate multiplication of partitioned matrices as in the example here. Using the Insert Menu, you can build a matrix and draw lines between rows and columns. However, I want to be able ...
0
votes
0answers
61 views

I see error messages when I use LogLinear Plot but not when I use Plot

I have written an application with Manipulate that plots the results of several calculations. What I find strange is that when I have my application use ...
1
vote
3answers
48 views

Collect the lists

I have a list of lists from which I pick out the positions of the number 1 and then print out these positions for each list. I am having some trouble collecting what I am printing into a list / matrix ...
2
votes
1answer
116 views
0
votes
0answers
53 views

deleteduplicates Delete elements of a list [duplicate]

I have a math problem about Mathematica, I am looking help from you. I hope that you could help me. The Math Problem: list= { {0,0,1},{1,0,0},{0,1,0} ,{1,2,3}}; ...
2
votes
3answers
126 views

Speeding Up Replacing of Labels in Large Matrix?

I am Mathematica novice and am trying to find a fast way to replace labels in some rather large matrices (512x512 or 1024x1024) that have resulted from segmenting images with WatershedComponents or ...
2
votes
2answers
173 views

Binarizing a matrix

I have an image with a few bright pixels with the remaining ones very dark. The difference is in orders of magnitude. I want to binarize this matrix (corresponding to the image) making all values ...
2
votes
4answers
211 views

How to plot a graph from it's incidence matrix?

I'm using Mathematica v9 and am trying to draw a graph by using it's incidence graph, but it won't draw it, which occurs an error "is not a valid incidence matrix.". But I've checked my matrix, and ...
6
votes
2answers
355 views

How to estimate the matrix condition number in the 2-Norm?

The Mathematica documentation say it is possible to estimate the Matrix condition number in norm 1, 2, Infinity. But the 2-Norm raise a message. This is an extract from reference documentation ...