Questions on the manipulation of matrices in Mathematica.

learn more… | top users | synonyms (1)

1
vote
3answers
163 views

Conditional Check on Matrix

Suppose I have the following matrix (i,j): ...
0
votes
0answers
80 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
55 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
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
105 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
120 views

Why Eigenvalues thinks matrices are non-numerical

I use Mathematica version 9.0.1. ...
5
votes
3answers
274 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
192 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
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
2answers
120 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
2answers
114 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 ...
0
votes
0answers
48 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
53 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
1answer
191 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
53 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
99 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
126 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 ...
1
vote
1answer
96 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: ...
3
votes
1answer
180 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.
6
votes
4answers
280 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\\ ...
1
vote
2answers
203 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 ...
0
votes
1answer
73 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, ...
6
votes
4answers
567 views

Check if a matrix is Positive Semidefinite

I have a question concerning the check whether a given matrix is positive semidefinite or not. In mathematica the function PositiveDefiniteMatrixQ[m] tells me ...
0
votes
1answer
196 views

How to speed up the computation of a specific array

I am doing some calculations on superconductivity and I REALLY need to speed up the way I calculate one of my arrays. I will put the input to the matrix (of course a tiny toy model of what I am ...
1
vote
0answers
183 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). ...
8
votes
3answers
354 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 ...
1
vote
2answers
114 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 ...
2
votes
1answer
159 views

How to use adaptive precision in matrix computations?

I wish to compute the pseudo inverse of rectangular (or square) matrices by the cubically method of Chebyshev given by $X_{k+1}=X_k(3I-AX_k(3I-AX_k))$ where $X_0=\frac{1}{\|A\|_F^2}A^*$. The procedure ...
5
votes
1answer
139 views

Is it possible to lower the bitwidth of (floating point) numbers?

The answer to this question will most probably be a definite no. Nevertheless, I would like to know whether it is possible to represent reals in the memory on less than the standard 32 or 64 bits ...
1
vote
2answers
117 views

Add a column to a matrix as a function of the other columns

I was wondering if its possible to add a column to a matrix by a formula that uses all other columns, like this: ...
0
votes
2answers
273 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 ...
9
votes
4answers
3k views

How can I multiply matrix and vector element wise like Numpy?

I have an $M \times K$ matrix $C$ and a length $K$ vector $v$. I want to form the $M \times K$ matrix $S$ where $s_{ij} = C_{ij}/v_j$. To do this in numpy I simply divide the two objects like this ...
1
vote
3answers
195 views

Creating overlapped block matrices

I'm doing an FEM assignment using Mathematica. (EK1 = {{a11, a12}, {a21, a22}}) // MatrixForm (EK2 = {{b22, b23}, {b32, b33}}) // MatrixForm I don't know how ...
2
votes
2answers
235 views

Is there a way to parallelize the convolution component of EdgeDetect?

Provided an image like - test = Import["http://upload.wikimedia.org/wikipedia/commons/d/d5/Sunflowers.jpg"] We can run ...
1
vote
4answers
168 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
352 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
195 views

Solving for equilibrium distribution (symbolic) by matrix multiplication

I have a huge transition matrix (81x81). The matrix is too huge to paste here, so I store it in this notebook. (There are constraints on the symbols: $0<p_b<1$ and $0<p_g<1$. If further ...
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
116 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
142 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 ...
2
votes
1answer
122 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 & & \\ ...
1
vote
0answers
147 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, ...
12
votes
6answers
613 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 ...
3
votes
2answers
120 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 ...
1
vote
1answer
90 views

Transform list of inequalities into matrix form $A\ x \leq b$

I have a list of linear inequalities, and I want to get it into the form $A\ x \leq b$; i.e., find the matrix $A$ and the vector $b$. Is there any function in Mathematica that can that can do this?
0
votes
3answers
176 views

Determinant of a random matrix consisting of integers

I am trying to implement a function that finds the determinant of a random matrix consisting of integers. This is the code I have written so far, but I am stuck. Suggestions ? I want to find a ...