Tagged Questions

Questions on the manipulation of matrices in Mathematica.

learn more… | top users | synonyms (1)

4
votes
0answers
30 views

Eigensystem on HPC

I am submitting Mathematica jobs to an HPC. I have a large matrix that is a function of (x,y) and I am diagonalizing it for around 500 points in the plane. My initial idea was to request a node with ...
3
votes
1answer
445 views

Over 30mins to generate the first eigenvector?

Is it normal for Mathematica to take over 30mins to try to compute the first eigenvector of a 100x100 matrix? The matrix is reasonably sparse - about 90% of the cells are 0s and each column sums to ...
1
vote
1answer
63 views

How to form a variable from matrix elements

I have matrix with n rows and 2 columns, say m = {{x11, y12}, {x21, y22}, ..., {xn1, yn2}. Now, I want to form three new variables for example: ...
0
votes
1answer
50 views

Submatrix with linearly independent columns

What I want is the submatrix where all the linearly dependent rows have been eliminated. I tried implementing this solution, but it doesn't work in the following example: ...
0
votes
0answers
42 views

How to display a list using numerical values? [duplicate]

Suppose I compute the eigenvectors of a matrix like this Eigenvectors [{{3, 2, 3, 1}, {2, 3, 1, 1}, {0, 0, 2, 1}, {2, 3, 2, 1}}] The result I get looks like: ...
2
votes
1answer
217 views

Quick way to tell if matrix is integer-only?

What's the most shortest one-liner code to tell whether a matrix is integer-only? I've come up with: Length@Cases[A // Flatten, _?(Not@*IntegerQ)] == 0 but ...
1
vote
2answers
34 views

Exporting mixed data of matrices and vectors / lists

thank you for reading my question. I have a problem trying to export mixed data from Mathematica. I have different matrices and vectors, which should be combined to a output file. Here a ...
2
votes
1answer
100 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 ...
11
votes
5answers
3k views

Division by zero is slow

Suppose I have two arrays of data, which I want to divide: ...
1
vote
1answer
86 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!
3
votes
1answer
88 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. ...
5
votes
4answers
200 views

How to extract a part of matrix satisfying certain condition(s)

I have a following matrix ...
0
votes
0answers
48 views

Sundaram's Matrix in Mathematica [closed]

How to Implement the Sundaram's Sieve in Mathematica? If a number is in the Sundaram's matrix I wanted to know the row and column.
2
votes
0answers
26 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 ...
4
votes
3answers
97 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?
0
votes
1answer
44 views
1
vote
0answers
48 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
42 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
38 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 ...
1
vote
0answers
94 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. ...
3
votes
0answers
46 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
0
votes
1answer
40 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
73 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
70 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 ...
2
votes
3answers
69 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 ...
9
votes
1answer
175 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
40 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] ...
1
vote
1answer
79 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
75 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 ...
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?
5
votes
0answers
134 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 ...
8
votes
3answers
686 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
93 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
94 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
119 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
100 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
53 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 ...
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
86 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
166 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
2answers
245 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 ...
6
votes
3answers
151 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
300 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 ...
0
votes
0answers
32 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 ...
8
votes
3answers
290 views

Random Integer Sequences

I want to construct a random square matrix in the following manner: a) Three states [0 | 1 | 2] are repeated ...
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. ...
2
votes
1answer
130 views

An intuitive way to form an augmented matrix

Given an $m\times n$ matrix $A$ and a $m\times 1$ vector $b$, what is the most "intuitive" way of forming the augmented matrix $[ A\ b]$? The most concise way that I know of is ...