Questions on the manipulation of matrices in Mathematica.

learn more… | top users | synonyms (1)

0
votes
1answer
143 views

Defining a new matrix product of matrix function

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. ...
1
vote
0answers
67 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
259 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
68 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 ...
2
votes
1answer
88 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
53 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
40 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 ...
1
vote
0answers
67 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
1answer
72 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
97 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
138 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 ...
0
votes
0answers
25 views

Calculating Muliti-integral Time-Ordering operator [migrated]

I am trying to solve the time-ordering operator Like this: $S(t)=\mathcal{T}e^{\int_0^tduA(u)\int_0^udvB(v)}S(0)$. How can I calculate S(t) with minimum error?
2
votes
4answers
89 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
180 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 ...
3
votes
2answers
209 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: ...
0
votes
1answer
71 views

How to power-series expand determinants?

Say $g$ is a matrix which is given as, $g = g_0 + xg_2 + x^2 g_4 .. +x^{d/2 -1}g_{d-2}+ x^{d/2}(g_d + h_d(log (x)))$ where $d$ is an even number and each $g_i$ is a matrix (same dimension as $g$) and ...
1
vote
2answers
74 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: ...
22
votes
2answers
334 views

eigenvector bug?

I have a fairly simple $3\times3$ complex matrix, $$ M=\left( \begin{array}{ccc} \frac{7}{2}-\frac{i}{2} & -1+i & \frac{1}{2}+\frac{5 i}{2} \\ -1+i & 5+i & -1+i \\ ...
1
vote
1answer
57 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 \\ ...
0
votes
1answer
89 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 ...
8
votes
8answers
668 views

Replace interior of matrix with zeros

I have f.e. the following square matrix: ...
5
votes
6answers
633 views

A matrix-vector cross product

I want to do a cross product involving a vector of Pauli matrices $\vec \sigma = \left( {{\sigma _1},{\sigma _2},{\sigma _3}} \right)$; for example, $\vec \sigma \times \left( {1,2,3} \right)$. ...
2
votes
1answer
85 views

Matrix constructed as a function inside a for-loop [closed]

I am trying to construct a matrix A which depends on variables x and y through iteration. My ...
1
vote
2answers
124 views

Generic Matrices

A multivariate Gaussian distribution for $k$ dimensions looks like this: $$\frac{1}{\sqrt{(2\pi)^k|\mathbf \Sigma|}}\mathbf e^{ -\frac 1 2 \mathbf x^T \mathbf \Sigma^{-1}\mathbf x }$$ $\mathbf x$ ...
0
votes
1answer
69 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 ...
15
votes
11answers
1k views

Efficient way to build a certain quadratic matrix

For odd n I'm looking for a short and swift way to construct with (f.e.) n = 3 n = 11 ...
0
votes
2answers
49 views

Modifying elements of a matrix after construction [closed]

Suppose I have constructed a matrix with all elements as a constant (say 1): N=4; A=ConstantArray[1, {N, N}]; Now I want to make A(2,3)=23 and A(4,3)=43. Can I ...
0
votes
1answer
44 views

How to track row swap in Gaussian elimination?

How do I track which rows were swapped in the Gaussian elimination using RowReduce? I am doing metabolic control analysis on a mathematical of the energy metabolism I have in Mathematica. I need to ...
0
votes
0answers
24 views

SVD (Singular value decomposition) for matrix with constant row sum and column sum [migrated]

M is a m*n matrix, the row sum equals to (K/m) and the column sum equals to (K/n). After SVD, we can find three matrix U,S,V, M=USV where U,V are orthogonal matrix and S is diagonal matrix. I can ...
0
votes
0answers
46 views

Geometric Transformation not working - degenerate points?

I've successfully used FindGeometricTransformation to project the simplex triangle onto the x-y plane: ...
2
votes
3answers
172 views

How can I reproduce the MatrixForm, NumberForm, XyzForm behavior?

I wish to write a function like MatrixForm, that affect only display but not evaluation, i.e. a function that automatically is stripped away from output. More ...
6
votes
2answers
185 views

How to get rid of nested matrices

If I type into Mathematica TensorProduct[IdentityMatrix[2],IdentityMatrix[2]] It gives me a result that has nested matrices. How do I turn that into a normal ...
0
votes
2answers
63 views

solving series of matrices by simply multiplication

I have a number of matrices {2*2} containing element in series ....so by what method I solve that ... ...
1
vote
1answer
78 views

Checkbox Matrix

Is it possible to create a dynamically changing binary $n \times n$ matrix $A$, which appears to the user as a $n \times n$ matrix/table of checkboxes and the user can change the entries of $A$ by ...
1
vote
1answer
47 views

references in a nested matrix

I have a nested matrix n: ...
-4
votes
2answers
93 views

Output of mathematica. Quaternion to Matrix

If I have the following instructions: How will it be the output/how will it appears in Mathematica? something like this: I can't recognize the output in mathematica... How can I do to appear ...
4
votes
0answers
62 views

Bug in PositiveDefiniteMatrixQ?

This seems like a bug in PositiveDefiniteMatrixQ to me: ...
1
vote
0answers
71 views

How to sequentially select, from a large set of tuples (of matrices), those with a certain property

I'm interested in finding a computationally efficient way for selecting all tuples of matrices which have a certain property. The property I'm interested in is that I want the column sum, of f[the ...
28
votes
8answers
1k views

Longest path in 0/1 matrix

I have a matrix of 0's and 1's forming a number of disjoint paths:   I would like to find the lengths of the paths, and from that "spectrum," the longest length (in the above example: 27, ...
5
votes
2answers
99 views

Comparison Operation for Nested Matrices

I have a nested matrix n as bellow ...
0
votes
1answer
116 views

Rotation matrix $\to$ quaternion

I found a very good link about quaternions in Mathematica , but I don't know how to create a quaternion from a rotation matrix. Can anyone help me, please? Update I need this: A rotation may be ...
4
votes
6answers
385 views

Insert all elements from one matrix into another

I have two matrices $A$ and $B$ which are the same size. Each element of $A$ is a list of numbers. Each element of $B$ is just a number. How do I insert each element of $B$ into the corresponding list ...
2
votes
2answers
142 views

Measures of association, Concordant and Discordant

I want to calculate concordant and discordant pairs on nx2 tables. ...
0
votes
1answer
59 views

Matrix operations performed with column-vectors

We have 3 matrices: m1, m2 and b. We want to apply matrix operations (dot or sum) in a ...
3
votes
2answers
179 views

Addition of Matrices [closed]

How can I add the Matrices created by this: SeedRandom@0; Table[RandomInteger[{0, 34}, {2, 2}], {2}, {5}] // MatrixForm $\left( \begin{array}{ccccc} \left( ...
1
vote
2answers
125 views

Convert DelaunayTriangulation-> Graph->AdjacencyMatrix

Is there a way to convert a Delaunay Triangulation into a Graph structure so that one can generate an AdjacenyMatrix of the Delaunay?