Questions on the manipulation of matrices in Mathematica.

learn more… | top users | synonyms (1)

0
votes
3answers
133 views

Implementing nested subtotals

Inserting a nested subtotal in a spreadsheet is a facility that Excel performs very well. But if a subset of this facility can be implemented in MMA for a table which needs it the hassle of its ...
1
vote
3answers
330 views

How to expand the size of the matrix automatically?

I have a matrix in 2x2 a ={{x, y}, {z, u}} I want to expand this matrix 3x3 b ={{x, y, y}, {z, u, x}, {z, x, u}} 4x4 ...
1
vote
1answer
430 views

Contracting with Levi-Civita (totally antisymmetric) tensor

I have an array $v_{ijk}$ which is effectively a rank-$3$ tensor with dimensions $3\times3\times3$, and I need to contract it with $e^{ijk}$, i.e. evaluate $v_{ijk} e^{ijk}$ (see Einstein ...
2
votes
3answers
137 views

Join matrix based on conditions

Given the following matrix: ...
1
vote
3answers
143 views

Conditional Check on Matrix

Suppose I have the following matrix (i,j): ...
0
votes
0answers
74 views

Back Linear Substitution

I have an equation set Ax=b and A(n*m),n<m . To lower down the dimension, I express some vars by other vars, which gives ...
0
votes
0answers
53 views

eigenvalues and eigenvectors without Root answers

I'd like to find eigen values and vectors of parametric 21*21 Matrix and i cant solve the root problem.please help me to find the answers without Root. My Matrix is: ...
0
votes
2answers
116 views

setting real parameters in Hamiltonian matrix

The following Matrix represents my Hamiltonian. m = {{ B/2 - d - j/2 + a, (Sqrt[2]*j)/2, M}, {(Sqrt[2]*j)/2, B/2 + a, 0}, {M, 0, (-3*B)/2 - d + j/2 + a} How can ...
0
votes
0answers
23 views

Jacobian matrix formation from polynomial expressions [duplicate]

I want to find the jacobian matrix for 3 polynomial expression with 3 variables.. the polynomial expressions have the degree of 8.how to form it.?
-1
votes
1answer
94 views

Solve set of non linear differential equations [closed]

I have set of differential equations. For example, I took two equations and tried to solve them as below. I am not getting any results. Please help me to figure it out the mistake. And I wonder if I ...
0
votes
1answer
112 views

Why Eigenvalues thinks matrices are non-numerical

I use Mathematica version 9.0.1. ...
3
votes
2answers
99 views

How do we make a negative integer out of a string of a negative number and vice-versa?

Negative numbers are not taken into consideration by mathematica's built-in functions. FromDigits["-2"] Gives me this message: ...
5
votes
3answers
269 views

Question about Map and Total

Suppose I have a list and I want to generate a new list, such that $$ NewList[index] = \sum_{index \neq j}^{NumOfElts} \frac {1}{ \lvert OldList[index]-OldList[j] \rvert ^2 } $$ Can I do it using ...
0
votes
1answer
65 views

Produce a 1-dimensional list of all unique matrix elements

We have some symbolic matrix m, e.g. m={{1, x, 4 x + y},{0, x y + 4x, 4x},{7 x, x, 4x + x y}} and we want to produce as output a list of all the unique elements ...
0
votes
1answer
167 views

Extracting coefficients from multiple equations and generating coefficient matrix

after 6 hours reading about string patterns, string manipulations and trying ..and trying..I officially give up (for now) and ask for some help. I have some unorderly equations you will find here ...
0
votes
2answers
119 views

How to display output as symbols?

I have this piece of code which populates a matrix following different rules depending on row and column number: ...
0
votes
0answers
46 views

Differential curve geometry Frenet Formula [duplicate]

I am using Mathematica for differential geometry studies using Frenet Formulae. The problem is that I need to graph the solution curve r[t]. Suppose the curvature of a curve is k(s) = |s|and the ...
0
votes
1answer
51 views

Function output of two lists are only diagonal elements

I'm having a little crysis over here. What I basically want to do is some sort of 3D-Plot, but I'm only interested in the resulting values. I have two vectors x and p: ...
0
votes
2answers
103 views

Define a function on a parameter argument set to zero

Say I have an expression (matrix) that depends on several variables. f= {{a, b+c},{2a-b^2,c^5+a b}} I want to define new matrices with the single parameter ...
6
votes
7answers
1k views

How to select all elements above the main diagonal of matrix?

How to select all elements above the main diagonal of matrix? I need to create a list of them.
0
votes
1answer
161 views

Symbolic matrix simplification and solving

I am trying to expand or solve an equation that contains matrices for a certain matrix, but it is not working: ...
0
votes
0answers
49 views

How do I interpret the Roots syntax when I am finding the eigenvalues of a matrix [duplicate]

Here is an example of my problem: I am somewhat confused by the syntax of this. I am guessing that the #1 is specifying the start of another root? Why then does one of the roots = u + with nothing ...
0
votes
1answer
130 views

Applying a general formula

We are a group of students who are struggling with transforming this formula to run in mathematica. In fact there are many formulas that we are struggling with, but if we are able to see how this is ...
0
votes
1answer
90 views

How to faster map density matrix element to make differential equations

I have a time dependent matrix $M(t)$ of $L^n \times L^n$ size and want to write differential equations like D[M[i,j][t],t] = H[i,j][t] Here is my code: ...
-2
votes
1answer
69 views

I need to calculate sin[x] series summation for sin[A] where A is a 3X3 matrix

I am evaluating $\sin(A)$ where $A$ is a $3\times 3$ matrix. I have calculated it but now I want to check this with a Taylor series expansion of Sin[x]. What I am ...
4
votes
0answers
112 views

Discriminant of Characteristic Polynomial

I'm doing a calculation which finds the characteristic polynomial of a matrix with rather complex entries and then determines the discriminant of that polynomial. For smaller matrices up to around 7x7 ...
3
votes
2answers
445 views

Has Mathematica a function to compute the Smith Normal Form?

The Smith normal form is a matrix that can be calculated for any matrix (not necessarily square) with integer entries. See Wikipedia for a more elaborate description. Has Mathematica a function to ...
3
votes
1answer
164 views

Is there any faster way than Eigensystem to diagonalize a Hermitian matrix?

Is there any faster way than using "Eigensystem" to diagonalize(get all the eigenvectors and eigenvalues) of a Hermitian(self-adjoint) matrix? That would be amazing :). Thanks.
1
vote
1answer
94 views

How to place a matrix under controls (sliders) in a Manipulate?

I want to know how I can place a matrix under my sliders. Here is my code: ...
6
votes
4answers
251 views

Counting adjacent elements in a Matrix?

To start, I have a situation where I have some matrix, for example $$ A=\left[ \begin{matrix} 4&2&2&3&3\\ 2&3&1&2&3\\ 3&0&4&0&4\\ ...
0
votes
1answer
65 views

Solving symbolic matrix equation

I have this equation, $$f(x)=Ax-diag(x)(Ax+b)$$, where $x\in \mathbb{R}^n$, $A\in \mathbb{R}^{n\times n}$ and $b\in \mathbb{R}^n$, for which I need to find the zeros. $x=0$ is an obvious solution, ...
0
votes
1answer
190 views

Symbolic Jacobian computation

I have an equation for which I would like to compute the Jacobian symbolically. $$f(x)=Ax-diag(x)(Ax+b)$$, where $x\in \mathbb{R}^n$, $A\in \mathbb{R}^{n\times n}$ and $b\in \mathbb{R}^n$. I am new ...
1
vote
2answers
194 views

Fast randomization of a graph, while keeping the graph connected

I'm looking for a very efficient method for randomizing graph of a given size (N nodes, L links), but keeping them connected. Assume you have the adjacency matrix A of a given connected graph. You ...
1
vote
0answers
158 views

How to extract connected bipartite graph from incidence matrix

I'm trying to extract a connected bipartite graph Bconn from the a given incidence matrix B- I have a matrix representing a bipartite graph - the incidence matrix B (weighted or not is unimportant). ...
4
votes
3answers
740 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
106 views

How to create automatically some matrices for symbolic manipulation?

I want to create in an automatic way some matrices to do symbolic calculations with them. They look like these: $$ \left( \begin{array}{cccc} a & 0 & b & 0 \\ 0 & 1 & 0 & 0 ...
8
votes
3answers
305 views

How can I complete a correlation matrix with missing values?

I would like to complete a correlation matrix with missing entries, such that the resulting matrix is positive semi-definite. Say I want to find some x and some y in the next matrix that satisfy ...
0
votes
2answers
209 views

Defining a function in terms of matrix elements

Currently trying to use elements from a matrix in defining a function however having some trouble. This is a somewhat simplified version of the problem. Say I have the matrix ...
1
vote
1answer
171 views

How Manipulating a matrix and a graphic in only one Manipulate? [closed]

I have to manipulate a matrix and graphics in one big Manipulate-Block. This way: Manipulate[Matrixform[mat],Graphics3D[]] How can I achieve that? Ok, here my ...
1
vote
4answers
159 views

Efficient replacement of conditional nested Do over elements of a matrix

I have two matrices like these: m1=Table[Random[],{i,10},{j,10}] m2=Table[Random[],{i,10},{j,10}] I want to create a new matrix in which its main diagonal ...
10
votes
3answers
324 views

Zero-dimensional matrices

In a recent Mathematica project, $(n \times 0)$- and $(0 \times n)$-dimensional matrices have suddenly become a frustratingly common edge case for me. For instance, consider the following two ...
0
votes
0answers
74 views

An error in converting matrix to quaternion

Here is an old quaternions package. There is a function named MatrixToQuaternion, References are here Matrix in that document is ...
0
votes
1answer
111 views

Summation matrix

I have problem with summation when it is in matrices. I want to make mathematica compute this: Large X I have added dataset for as well as e. Would anyone be able to show me how to compute this in ...
1
vote
2answers
126 views

How to sort Table/Matrix including legend(Labellings)

I want to sort table including its legend for graph I have table similar to M1 M2 M3 1 5 2 3 1 4 4 2 -10 5 7 11 6 -2 1 ...
1
vote
0answers
136 views

Efficient submatrix swaps for large sparse matrix

I am implementing the 'swap' algorithm for a binary matrix to generate matrix permutations that maintain row and column totals. My problem is that my matrices are large and sparse (e.g., 19774 x 942, ...
1
vote
1answer
119 views

Decomposing a diagonal positive real matrix

I would like to 'decompose' a diagonal positive real matrix $E$ of rank $D$ onto $\sum_{i=1}^{D}c(i)N^i$: $$E = \left( \begin{array}{ccc} 0 & & & \\ & a & & \\ ...
3
votes
2answers
118 views

Select elements of a Matrix that are the same (or have certain relationship) and return their position and the element itself

I have a matrix and I want to pick the elements that are the same and return their positions and their values. It seems easy to me, but all I know is how to pick elements that satisfy certain ...
12
votes
6answers
600 views

Elegantly split a matrix into positive and negative parts?

I have a matrix $M$ of real components, and I want to split it into two matrices $M^+$ and $M^-$ of the same dimensions as $M$, where $M^+$ contains the positive components of $M$ (the remaining ...