Questions on the manipulation of matrices in Mathematica.

learn more… | top users | synonyms (1)

0
votes
1answer
44 views

Importing a Matrix whit different column numbers depending on the row

I have a bunch of coordinates given in a file. The file contains Startpoints and Endpoints of arrows in columns(Example): ...
3
votes
6answers
318 views

How can I construct a distance table?

I have a list of city names (of arbitrary length), f.e. c = {"BAL", "NYC", "LAS", "AUS"}; and the distances between them : ...
1
vote
3answers
124 views

Working with nested matrices

I have a matrix: A = {{a, b}, {c, d}} But each its element, itself, is another matrix too. ...
0
votes
1answer
64 views

Swapping rows and columns in matrix [closed]

If I have an array like the following $\left( \begin{array}{ccc} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{array} \right)$ How can I swap the rows and columns, so it is ...
1
vote
1answer
116 views

Matrix and random, weighted assignment of rows

I asked a question in this category previously but my problem has changed. On one hand, I have a large number of data files as .dat format, and on the other hand, I have a matrix ...
1
vote
1answer
46 views

Correctly substituting a matrix into a scalar equation [duplicate]

I am having trouble correctly substituting a matrix into an (originally) scalar equation. For example: A = {{3, 1}, {1, 2}} cp = CharacteristicPolynomial[A, x] ...
1
vote
1answer
76 views

Calculate the algebraic multiplicity of known eigenvalues of a large, sparse matrix

I have a large (and sparse) matrix with size 1000x1000 -- 10000x10000. I believe i know all eigenvalues for the matrices. All entries are integers and so are the eigenvalues. I want to check this by ...
1
vote
1answer
37 views

Evaluation of m.v is blocked by applying MatrixForm. Why? [duplicate]

I'm trying to understand what is happening in the notebook session below. I have a 2x2 matrix m = {{-1,-1}, {-1,-1}}. And a vector ...
1
vote
2answers
135 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?
0
votes
1answer
152 views

How to create a 2D array (matrix) [closed]

I am pretty new to Mathematica. I need to create 2d array dynamicly. I got some code in C++(Qt) and it looks like this: ...
1
vote
1answer
80 views

Matrix and string variable

There are $100$ .dat data files which contain numerical parameters. ...
4
votes
2answers
117 views

Checking powers of a matrix for zeros

I'm currently working on a project that deals with numerical semigroups and their connection to matrices. I'm pretty new to Mathematica, so I wouldn't be surprised if my question has a simple ...
2
votes
1answer
57 views

Sorting a matrix except its last row

Given M = {{"Utah", 2}, {"Iowa", 1}, {"Maine", 3}, {"Total", 6}} I want to obtain the reverse-sorted result like this: ...
2
votes
2answers
128 views

Building adjacency matrix from set data

I have two sets: games and players. Players pick their games. As such I will have data say g1={p1,p3,p5},g2={p2,p4},g3={p2,p3,p5}. My interest though is to build the connections among players because ...
1
vote
0answers
58 views

vector/list containing matrices as elements dot product [closed]

mA = {{a11, a12}, {a21, a22}}; mB = {{b11, b12}, {b21, b22}}; mC = {{c11, c12}, {c21, c22}}; mD = {{d11, d12}, {d21, d22}}; v={{mA},{mB}}; w={{mC},{mD}}; What I ...
2
votes
1answer
103 views

Loop in solving multiple matrix calculation

I am wondering is there a way to use loop, like Do, For, to rewrite the last line in the code. I tried to use ...
0
votes
1answer
87 views

Select positive value from a vector

I am wondering how to pick out the positive Omega value from soln, and make these positive values into a row vector. I know how ...
0
votes
1answer
103 views

Factor vector out of a matrix

I am wondering how to factor a[1],a[2],...,a[4] out of sim so that I can write sim as the ...
0
votes
1answer
87 views

Mapping a function over n levels

I want to map a function over a matrix of rank n, for example: ...
1
vote
2answers
106 views

How to drop the identical rows and columns of a matrix?

I'm currently trying to find a way to eliminate from a square matrix of generic dimension the duplicate (up to sign) rows and columns, obtaining a smaller dimensional matrix. I searched around here ...
2
votes
2answers
136 views

Matrix exponential via Cayley-Hamilton Theorem

I'm attempting to calculate the exponential of a matrix via Cayley-Hamilton theorem. (Following the "concrete example" from http://en.wikipedia.org/wiki/Cayley%E2%80%93Hamilton_theorem) I am having ...
0
votes
2answers
122 views

Make an effective projection of matrix

To best explain my problem, I will take the following example: Consider the following matrix : ...
0
votes
0answers
44 views

Extracting Coefficient Matrices from partial differential equations

I have a system of differential equations which are in the form Dt[a01,t] + u*Dt[a01,x] + v*Dt[a01,y] + w*Dt[a01,z] I have ten of these equations and my ...
1
vote
3answers
94 views

Finding if a matrix is square

I have a matrix which is constructed element by element through some iterations, and thus can be non-square. If it's not square, then I want to make it square filling with ...
2
votes
0answers
96 views

A math function similar to “LatticeReduce” for finding linear independent basis

We would like to ask a math function similar to "LatticeReduce" for finding linear independent basis. The input is a list of vectors $M=\{v_1,v_2,v_3,\dots\}$, with the following property: There is a ...
2
votes
1answer
93 views

How to define a matrix with all elements 0? [closed]

A matrix can be defined as M = Array[m, {3, 3}] which gives ...
2
votes
1answer
135 views

Find positions where two matrices differ

I have two matrices A and B of identical dimensions. What's the simplest (shortest) way to find the indices of differing ...
1
vote
1answer
60 views

Importing adjacency matrix from file of 0/1 arrays

Is it possible to import adjacency matrix for graph representation, from simple text file with NxN (rows x columns) of 0s/1s: 0 1 0 0 1 0 1 1 0 1 0 0 0 1 0 0
3
votes
1answer
132 views

Are there any more time-efficient ways to solve a matrix equation than with SparseArray and LinearSolve?

I am trying to solve a matrix equation, with the matrix being tridiagonal. The problem I am having is that a message keeps appearing that I don't have enough memory. Here is the code: ...
5
votes
2answers
332 views

Combining three R, G, B matrices into a single matrix of 3-tuples?

Working with Mathematica 8 on OSX here. I have three $1024 \times 1024$ matrices representing the counts from consecutive exposures onto a CCD with $R$, $G$, and $B$ filters on it, and am looking to ...
0
votes
1answer
64 views

Show List of HighlightGraph Objects in Matrix

I'm new to Mathematica and can't get my problem solved. I want to display a list of HighlightGraph objects in MatrixForm like ...
2
votes
1answer
136 views

Multiple swapping of rows and columns

m={{a, b, c, p}, {d, e, f, x}, {g, h, k, z}, {u, v, w, y}}; I want to swap 1st and 2nd rows by 4th and 3rd rows respectively. And then, swap 1st and 2nd columns ...
3
votes
1answer
129 views

Plotting with ColorFunction -> GrayLevel - no black

This is probably a fairly trivial question, yet I have been unable to find an answer - help would be much appreciated! :) I am trying to plot a 28 x 28 matrix (tabulated data given here), containing ...
0
votes
0answers
43 views

TableDirection in TableForm

I got confused about what does "the outermost dimension" and "the first dimension" mean in the document I snipped. Does it mean row or column?
0
votes
0answers
45 views

Find the values of parameters so that the matrix is symmetric positive definite

Good evening , I have a matrix 20x20 in symbolic form. The matrix depends on 5 parameters (a,b,c,d,e). I would like to get the interval of each parameters that ensures that the matrix S is symmetric ...
1
vote
2answers
98 views

How to sort the adjecency matrix of bipartite graph so to have two off-diagonal blocks

In a bipartite graphs there are two class of nodes, say A and B. Each node of class A may interact only with nodes of the class B, and viceversa. The corresponding adjecency matrix is thus composed by ...
4
votes
3answers
287 views

Finding parameters making real part of eigenvalues vanish

I have the following $\;3\times3$ matrix: $\left( \begin{array}{ccc} 0.04 -0.4 b & 0 & 0.04 -0.4 b \\ 0 & -0.08-1.2 b & -0.06-0.9 b \\ 1.04 -0.4 b & 2.08 -0.8 b & 0 ...
0
votes
0answers
43 views

How to get integer/rational and real eigenvectors to be the same? [duplicate]

forgive me if I missed this already being answered or too easy. Given a matrix: q = {{1, 3, 5}, {7, 11, 13}, {1/3, 1/7, 1/13}}; Eigenvectors are different here: ...
0
votes
1answer
118 views

How to get more accurate orthonormal eigenvectors?

I have a matrix M with real entries in MachinePrecision. I compute its eigenvectors and construct matrix ...
0
votes
0answers
57 views

How to compute variances from a matrix/table

I have created a matrix/table with an imported dataset. I want to know what the variance is for 3 values at a time but across 68 columns. I would like to do this in an automated way rather than 1 set ...
0
votes
0answers
26 views

Mathematica program for PLUR decomposition of a symbolic matrix using full pivoting

I wanted to ask if there is a Mathematica program for PLUR decomposition of a symbolic matrix M, such that M = P*L*U*R, using FULL (row and column) pivoting, and where R = reduced row echelon form of ...
0
votes
0answers
61 views

Computing residues of matrix valued functions symbolically

I have a somewhat specific application in mind, but I've run into this kind of problem a few times and never found an elegant solution. Is there an efficient way to get Mathematica to recognize that ...
1
vote
1answer
46 views

Formatting All Appropriate Output as Desired Automatically

I want to output in MatrixForm whenever I have a list/vector/matrix, but I do not want to have to type out the command each time. How can I write one command at ...
3
votes
2answers
168 views

Package for representation of groups (group theory)

I wanted to know if there is a package which allows to compute representations of a group like the definition representation, adjoint and so on (for example the Pauli matrix for $SU(2)$ if I specify ...
0
votes
1answer
36 views

Generate array of every $n^{th}$ integer between two bounds [closed]

I want to generate the series {1930, 1934, 1938, ..., 2014} with Mathematica. I found that I can use Sum[2014-m*4, {m, 20}] to ...
1
vote
1answer
86 views

Mathematica does not respect tensor order?

I'm trying to verify an identity involving symmetric traceless tensors over the reals. What I tried was: ...
7
votes
1answer
187 views

Symbolic scalar-by-matrix derivative

Let's say I want to calculate the following scalar-by-matrix derivative $$\frac{\partial}{\partial A} \text{tr} \left[(\vec X^T A)^T (\vec X^T A)\right],$$ with $\vec X$ and $A$ being a $n \times 1$ ...
2
votes
1answer
157 views

Plot 3D boolean Array or matrix in Mathematica

I have been attempting several methods to plot a 3D diagram of a n by n boolean array in Mathematica but none of them produced satisfactory result. I want the $3D$ plot to have a cube when ...
0
votes
1answer
121 views

Determinant of a square matrix with univariate polynomial entries is not a polynom? [closed]

I have a 15x15 Matrix with all polynomial entries. I want to calculate the determinant of the matrix. To my understanding the determinant should be a (albeit high order) polynom, too. And the paper, I ...
0
votes
1answer
151 views

Simplify matrix into an upper triangular matrix

I have a tridiagonal matrix that I am trying to simplify into an upper triangular matrix using Mathematica, so I can use back substitution and solve my linear system. I have found the command ...