Questions on the manipulation of matrices in Mathematica.

learn more… | top users | synonyms (1)

0
votes
1answer
58 views

How to evaluate integrals over matrices [on hold]

Is it possible at all to evaluate integrals with respect to a matrix (dA, where A is a matrix) in Mathematica?
0
votes
0answers
24 views

What are the upper bound and stability conditions for the following simple linear system [migrated]

Consider the following linear system $$\dot{x}=\sum\limits_{i=1}^{m}{{{\alpha }_{i}}}\left( t \right)\cdot {{A}_{i}}\cdot x \quad (1) $$ where, $x\in {{\mathbb{R}}^{n}}$ represents the state vector, ...
0
votes
1answer
53 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 ...
3
votes
3answers
93 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 ...
3
votes
2answers
206 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 ...
4
votes
3answers
145 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
633 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
89 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
90 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 ...
1
vote
2answers
61 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
42 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: ...
0
votes
1answer
57 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: ...
4
votes
2answers
182 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 ...
3
votes
2answers
102 views

Time-efficient manipulation (zeroing) of expression

I have huge matrices in the form of ...
0
votes
0answers
43 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 ...
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 ...
1
vote
2answers
108 views

Sort matrix rows iteratively according to sum of some columns

I have a matrix say ...
3
votes
2answers
100 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, ...
-2
votes
1answer
55 views

$SU(4)$ Structure constants in mathematica

How can I write a mathematica function which will output arbitrary structure constants of SU(4)?
3
votes
3answers
83 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 ...
1
vote
1answer
63 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 ...
0
votes
1answer
45 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 ...
3
votes
3answers
247 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 ...
1
vote
2answers
82 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
217 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 ...
10
votes
8answers
330 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
0answers
44 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
2answers
34 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
4answers
136 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)$ ...
0
votes
1answer
81 views

Mean squared error of two matrices

I want to compare two matrices. For this I use the mean squared error between them with the following code mse[mat1_, mat2_] :=(mat1 - mat2)^2 // Flatten // Mean ...
1
vote
0answers
71 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
281 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
79 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 ...
0
votes
0answers
56 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 ...
2
votes
1answer
95 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 ...
1
vote
3answers
44 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
83 views

Why won't Mathematica obtain eigenvectors for this symmetric matrix?

The matrix is a real symmetric 4x4: ...
1
vote
0answers
71 views

How to stack matrices: one on top of another? [closed]

I have over 10 thousands matrices each with n by 3 size. For example, M[1]={{1,2,3},{4,5,6},{7,8,9}}, M[5]={{10,11,12},{13,14,15}} and M[20]={{16,17,18},{19,20,21},{22,23,24},{25,26,27}}. I want to ...
2
votes
2answers
144 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
3answers
106 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 ...
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
4answers
93 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 ...
3
votes
2answers
225 views

All possible pairs of two items

I have 4 different items {1, 2, 3, 4}. I want to obtain all possible pairs of two of the items. I have written: ...
1
vote
2answers
77 views

Is there an easy way to divide a matrix into four blocks?

I often get a data table with column names and row names. For example: ...
3
votes
4answers
113 views
1
vote
1answer
82 views

Inverting matrix of unknown size

I have a matrix that has a variable number of columns and rows (but it is always square). The matrix is: $$ \Gamma = \begin{bmatrix} \Theta & 0 & 0 & 0 & T & 0 & R_j \\ ...
8
votes
8answers
681 views

Replace interior of matrix with zeros

I have f.e. the following square matrix: ...
6
votes
2answers
190 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 ...
0
votes
1answer
102 views

LinearSolve failing to find solution to system of linear equations of 64 variables

I've got a 64x64 Matrix L for which I want to find the solution to the matrix equation L . x == rho. L is defined as ...
0
votes
1answer
85 views

eigenvector bug also for matrix with numeric value [closed]

I just realize that probably there is a bug also in calculating the eigenvector of a matrix with numeric values (see here for bug in eigenvector calculation with symbolic value). In particular in my ...