Questions on the manipulation of matrices in Mathematica.

learn more… | top users | synonyms (1)

2
votes
1answer
129 views

Neighbourhood - Calculations

SeedRandom[0]; n = 5; (m = N @ RandomInteger[{1, 3}, {n, n}]) // MatrixForm result1 = MeanFilter[m, 1] // MatrixForm ...
0
votes
0answers
10 views

Is there any direct method for Lagrange multiplier based domain decomposed problem? [migrated]

In elastic problem, we often solve K * u = f, where K is the stiffness matrix, f the external force vector and u the displacement vector. I'm trying decompose the mesh to domains, using Lagrange ...
1
vote
0answers
101 views

Replace part in a matrix that matches specific pattern

I have the following problem. Given a matrix L which looks as follows, Matrix L is a link, route matrix. Further, I got the following vector (d), which indicates the demand per vertex combination. ...
2
votes
1answer
104 views

how to diagonalize this symbolic matrix?

m = {{0, 0, w}, {0, t, -w}, {w, -w, r}} use equation P^(−1)A P, how to obtain P with Mathematica? Thanks!
5
votes
4answers
232 views
3
votes
1answer
90 views

An efficient way to compare two matrices

I have two matrices mat1 and mat2, both are results from different algorithms that are supposed to calculate the same result. The nmax is around 300, the q varies from 0.001 to 1. ...
4
votes
3answers
101 views

A Product function for matrix products

I would like to use an equivalent of the product-function in mathematica, but where instead of multiplying numbers I multiply matrices?
2
votes
0answers
27 views

Automatically discover the class of an arbitrary matrix

In Wolfram|Alpha it is possible to discover some specific classes to which a matrix belongs. For instance, typing this in Wolfram|Alpha ...
0
votes
1answer
45 views
1
vote
0answers
53 views

Programming for matrix manipulation

I want to write a programme which operates on nd x nd matrices. The programme looks the matrix as a n x n block matrix where ...
2
votes
2answers
48 views

Returning the 3-dimensional vector from a skew symmetric matrix

I'm trying to write a function that takes in a skew symmetric matrix and returns the corresponding vector. When I write the following code, it works when I leave it as variables, but it does not work ...
0
votes
1answer
42 views

Display problem multiplying matrix [duplicate]

I'm multiplying matrices and I don't get answer I want I just get matrix M times matrix N, there is no result. What to do and ...
11
votes
3answers
3k views

Solving a time-dependent Schroedinger equation

I want to solve the time-dependent Schroedinger equation: $$ i\partial_t \psi(t) = H(t)\psi(t) $$ for matrix, time-dependent $H(t)$ and vector $\psi$. What is an efficient way of doing this so ...
3
votes
0answers
48 views

Calculation the eigensystem of a matrix containing very small numbers

I'm dealing with a matrix containing very small numbers like 10^(-370). Whenever I'm trying to calculate the eigensystem of that matrix, it takes too much time, though the matrix size is not big that ...
0
votes
0answers
65 views
25
votes
2answers
494 views

eigenvector bug?

Bug introduced in 7.0.1 or earlier and fixed in 10.0.0 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 ...
2
votes
3answers
71 views

How to get an element of a list , which is computed out of substituted variables?

What is the best way to get the element of a list, which is computed out of substituded variables? For example one wants to get the first element of the first row of ...
0
votes
1answer
45 views

Verticepair - route matrix

I have the following problem. I have two lists: list1 defines all possible commodities in a network g. E.g. Form vertex 1 to ...
5
votes
3answers
80 views

Mapping a function of the form matrix[[row,column1;;column2]] over a list

I want to create a list of lists of values by mapping values[[row, col1;;col2]] over a list like {{r1,c1,c2},{r2,c2,c3},... } to ...
1
vote
1answer
77 views

Matrix elements scope definition

Alright, I'm very new to Mathematica and I have yet to learn a lot so please bear with me (sorry if this is a duplicate!): I want to create an $n\times n$ matrix $C$ with elements $c_{i,j}$ with $i,j ...
9
votes
1answer
184 views

Compose many Geometric Transformations for 3D Graphics

I'm struggling to understand what would be a good way to compose several geometrical transformations to create a single TransformationFunction to be applied to a ...
1
vote
0answers
42 views

Creating a matrix from a list of simultaneous equations

I have a list of n simultaneous equations of the form, w A[n] = (K[n,n+1]+K[n-1,n])A[n] - K[n,n+1]A[n+1] - K[n-1,n]A[n-1] ...
0
votes
1answer
485 views

Computing the fundamental matrix and its monodromy matrix

Assume $\dot x(t)=v(x,t)$ is a $T$-periodic, with respect to $t$ dynamical system. That is: $x\in\mathbb R^n,\quad t\in\mathbb R,\qquad v(x,t+T)=v(x,t)$. Let $x_0$ be a smooth periodic solution in ...
4
votes
2answers
326 views

Rearranging a matrix

I would like to convert a matrix which has a structure like this: {{"A", 10, "D", 1},{"B", 3, "A", 2},{"C", 7, "B", 3},{"D", 6, "C", 4}}//MatrixForm//Print; ...
5
votes
0answers
357 views

Export matrix to $\LaTeX$ with style

Is it possible to export a matrix to $\LaTeX$ with style? For example this code will create a matrix with equal spacing matrix and with background colors in some cell, is it possible to export that ...
2
votes
2answers
76 views

Creating function with matrix argument

I am completely new to programming, so I apologize in advance for a stupid question. I want to program an algorithm for computing invariant factors of a finitely generated abelian group, so in ...
4
votes
1answer
123 views

Exported animated gif with matrices will not work?

I want to export a list of matrices as a gif so that they will appear one after another 2 seconds apart. I've tried the following but when I open it up it only does the first two matrices and I have ...
0
votes
1answer
90 views

Matrix Operation

I have a $3\times3$ matrix A, and a function sTrans that outputs two $3\times3$ matrices in a list when given a $3\times3$ ...
1
vote
1answer
97 views

Generate random nxn matrix with all negative eigenvalues

I need to generate an nxn matrix with random entries, but I also need all of the eigenvalues to be negative (real or complex doesn't matter). I have: ...
3
votes
1answer
81 views

Find the NullSpace of a matrix whose determinant is “almost” zero

If $A$ is a matrix such that $\det(A)=0$, it is easy to get a basis of the kernel of $A$ with NullSpace[A]. Now let's consider a matrix $B$, function of a ...
5
votes
0answers
143 views

Is it possible to implement symbolic sub matrices?

The accepted answer in the following link: http://stackoverflow.com/questions/5708208/symbolic-matrices-in-mathematica-with-unknown-dimensions provides a functionality to create symbolic matrices ...
0
votes
0answers
59 views

Is there a command like meshgrid in Mathematica? [duplicate]

Just like the title, I need to do a meshgrid in Mathematica, is there any command like that?
8
votes
3answers
698 views

How to show matrix multiplication step by step?

Given a matrix, A: A = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}; How can I do the matrix multiplication A times A step by step?
-1
votes
2answers
64 views

Algorithm to generate a matrix [closed]

I need to generate a matrix from the following expression Sum[c^(i+j-2 k)(-1)^(-k+j)(i*j)/((i - k)!(j - k)!k!), {k, 0, Min[i, j]}] where i, j = 0,1,2,......N ...
1
vote
1answer
96 views

Expressing a matrix in terms of four basis matrices

I have five matrices and I want to represent one in the basis of other four. So how do I find the value of coefficients? For example, if the matrices are I1, ...
1
vote
1answer
102 views

Solving a System/Matrix of Equations in Matrix Form

Ok, I am trying to solve an equation involving matrices (well, tensors actually), which is of the form: $\mathbf{e}^{T} \cdot \mathbf{M} \cdot \mathbf{e}$ = $\mathbf{N}$, where $\mathbf{e}$ is an ...
3
votes
2answers
125 views

Convert matrix rows into variables

Can anyone show me how to set all matrix rows to variables. For example, I have matrix w={{1,2,3},{3,2,1},{0,0,0}} and I need to set each matrix row to be separate ...
1
vote
1answer
115 views

finding eigenvectors of a n*n symbolic matrix [closed]

is it possible to find eigenvectors and eigenvalues of this matrix in mathematica?i have no idea about solution!please help... ...
1
vote
1answer
62 views

How to simplify symbolic matrix multiplication using the associativity of scalar multiplication?

My input is (2A).(3B). Is there a way to get 6A.B? All I could get back from Mathematica was ...
6
votes
2answers
253 views

How to transform a matrix to upper-triangular with operation- tag elegantly?

Description: Recently, I have a thought that writing a function to show the transformation process when a matrix is transformed to upper-triangular. My trail ...
1
vote
1answer
99 views
0
votes
1answer
61 views

Solving at zeroes of a matrix - code only works for simple equation

I have a matrix of zeroes (True) and non-zeroes (False). The matrix is generated from a table of values of two other variables. I'm trying to observe how the solution for p3 changes with small ...
5
votes
3answers
90 views

SingularValueDecomposition outputs unsolved Root expressions [closed]

I have a simple 4x10 matrix of real integers (It's a Vandermonde matrix for x=1,2,...,10, if that's relevant) that I'm trying to do SVU decomposition on. When I use the SingularValueDecomposition ...
3
votes
6answers
168 views

Change last column of a matrix

Given a (rectangular) matrix of integers, i.e. RandomInteger[4, {10, 3}] I want to apply the following rules only to the last column ...
6
votes
3answers
154 views

Remove Successive Duplicate From A Large List (200k by 4 matrix)

I am interested in removing successive duplicate rows from a very large list (~200k rows by 4 columns) using Mathematica.The built-in 'DeleteDuplicates' seems to remove all duplicates, I am interested ...
8
votes
2answers
308 views

How to add a vertical line to a matrix?

Today, I want to write a program to show the solving process of a the inverse of a matrix, and I use the Elementary transformation, so I need to add a vertical ...
6
votes
3answers
213 views

Need help with plotting triple data points while xy data are not regular?

recently I plotted some figure in matlab whose quality is not so satisfactory, so I come to mathematica as my supervisor suggested. This is how it looks like in matlab:. In matlab I have three m by n ...
0
votes
0answers
35 views

Numerical Error with Matrix operations

A is a 3x3 matrix, b is a 3x1 vector. I try to convert [A|b], a 3x4 matrix, to [I|0]. So the formula is right multiple ...
1
vote
2answers
89 views

Verify positive definiteness using random numbers

I wish to verify whether T'T - IdentityMatrix[2] is always positive definite for a certain choice of elements of T'T. ...