Questions on the manipulation of matrices in Mathematica.

learn more… | top users | synonyms (1)

0
votes
1answer
96 views

Plotting a list of Eigenvectors

For my Fractional Calculus course, I was asked to find a matrix that arbitrarily represents the second derivative. This eventually got me a tridiagonal matrix. I was letter asked to find the ...
3
votes
2answers
213 views

How do you create matrices using submatrix building blocks?

Here is a conundrum I am facing. I have $2$ matrix building blocks. In my problem, I associate integer $2$ with $3\times 3$ matrix $A$ with structure \begin{bmatrix} 0& a& 0\\ c& 0& ...
1
vote
0answers
61 views

Multiply a matrix by a vector [closed]

I have one 3x2 matrix of coordinates in the following form ...
0
votes
1answer
157 views

Syntax::sntxf: “…” cannot be followed by “…\MatrixForm” [closed]

I'm trying to create a $3\times 1$ matrix named Pauli but I really don't understand what's the problem of the following code? ...
3
votes
1answer
93 views

Interpolation of ListContourPlot3D, Volumetric data (cube file)

I know there are lots of information about this on stack exchange! Data interpolation and ListContourPlot InterpolationOrder for ContourPlot Unfortunately I was not able to find a proper way to ...
3
votes
1answer
69 views

Large products of a matrix-valued function [closed]

I have a $3\times 3$ matrix valued function $f(x)$ where $x\in\mathbb{R}$. I want to perform the following: $$\prod_{k=a}^b f(k),$$ where $a,b$ are known, but I cant seem to get Mathematica to do ...
7
votes
2answers
166 views

Solve a time-dependent matrix DE using NDSolve

I am trying to numerically solve a time-dependent matrix DE using Mathematica. However, it seems that Mathematica freezes even for two-dimensional matrix equations. For example, we have: ...
-2
votes
1answer
60 views

solve Z of matrix [closed]

x=Cz+(lambda)z x and z are n*1 column vectors C is n*n matrix (lambda) is a scalar it want to solve for z. the hint is z=Iz where I is n*n also C+(lambda) is an invalid expression, but C+(lambda)I ...
2
votes
1answer
154 views

Eigenvectors of numerical matrix

I have a large numerical matrix whose eigenvalues are all distinct. In the documentation for Eigenvectors it says: For approximate numerical matrices m, the ...
4
votes
3answers
303 views

Constructing Tri-Diagonal Matrices

Fractional Calculus Course, we are instructed to create an $n \times n$ Tri-Diagonal matrix in the form of: \begin{array} a A &= \begin{bmatrix} 2 & -1 & 0 & 0 & ... ...
0
votes
1answer
47 views

How to create pairwise difference matrix entry?

I have a $16\times 1$ array of integer entries named $H$. How do I create a $16\times 16$ pairwise difference matrix between all entries in array?
0
votes
0answers
28 views

LUDecomposition does not give the expected results [duplicate]

Check this example: ...
1
vote
2answers
72 views

DiscretePlot3D: Part specification is neither a machine-sized integer nor a list of machine-sized integers

I want to plot a 3D histogram of a matrix and I am using this line: DiscretePlot3D[lmat[[x, y]], {x, 1, 3}, {y, 1, 3}, ExtentSize -> Full] where ...
0
votes
0answers
62 views

Is tensor argument passing to module expensive?

I wrote a simple module which is supposed to do recursive computation, however it turns out to be expensive even for 300 points. I am not sure why is it slow, all the computations seem to be ...
-1
votes
2answers
71 views
4
votes
2answers
260 views

Maximization in Mathematica using matrix and vector notation

I am trying to solve a simple maximization problem in Mathematica, using matrix and vector notation. ...
2
votes
1answer
129 views

When are sparse arrays effective?

Sparse arrays are not effective in Mathematica 10. More computational time is needed to perform arithmetic operations on sparse arrays. Their size is also bigger than normal arrays. Here is a simple ...
10
votes
2answers
226 views

Analytic determinant of a sparse 25x25 matrix?

I would like to compute the analytic determinant of the following sparse matrix ...
2
votes
2answers
146 views

The Chart of Matrix Eigenvalues : Energy Levels

There is the possibility that this question may have been asked previously, but as we are unfamiliar with the nature of the chart below, we hope to seek a response to this query. Consider a matrix as ...
12
votes
1answer
170 views

Nearest Kronecker Product

Some people (see The ubiquitous Kronecker product by Van Loan) have worked on finding two matrices $\mathbf A$,$\mathbf B$ of specified size whose tensor product $\mathbf A\otimes\mathbf B$ is closest ...
6
votes
3answers
233 views

How to simplify symbolic expressions with KroneckerProduct

Having $X,Y$ being symbols for matrices, I was wondering if there is a way to simplify expressions like KroneckerProduct[X, X] + KroneckerProduct[-X, X] to ...
1
vote
2answers
127 views

LUDecomposition for non-square matrices

How do we go about finding the LUDecomposition for non-square matrices. When i try to input the standard LUDecomposition ...
0
votes
1answer
62 views

Eigenvalues and Eigenvectors Order [duplicate]

Say I have a list of eigenvalues and eigenvectors produced from a matrix $M$ using the command {eig1,eig2}=Eigensystem[M], which will return the eigenvalues with ...
0
votes
1answer
34 views

Variable Definitions and Random Numbers [closed]

I have currently created the following matrix: m={{RandomReal[{0,1}],RandomReal[{0,1}]},{RandomReal[{0,1}],RandomReal[{0,1}]}} In other words, a $2 \times 2$ ...
0
votes
0answers
20 views

Matrix Multiplication and Product [$f$, {$i$, $i_{min}$, $i_{max}$}] [duplicate]

I tried the command Product[f, {i, i_min, i_max}], where $f$ is a matrix here, as a shorthand for a product of arbitrarily many matrices with elements parametrized ...
3
votes
1answer
80 views

Evaluating the product of a matrix sequence [duplicate]

I want to compute $$ \prod_{i=1}^n A_i = A_1 A_2 \cdots A_n $$ where every $A_i$ is a square matrix. When I execute ...
3
votes
1answer
107 views

updating matrix elements based on a condition

I am (still) fairly new to Mathematica and trying to perform some operation on the matrix elements, say for the matrix ...
14
votes
2answers
223 views

Fastest way to sum the upper triangle

I feel like this is an recurring question: if there's a symmetric matrix whose diagonal is not all 0, how could I get the sum of the part of it that's above the diagonal as fast as possible? Small ...
1
vote
1answer
58 views

Matrix issue with NDSolve

I am solving a differential matrix equation with NDSolve. ...
6
votes
2answers
196 views

improving sequence dot operator for matrix rows and plot of Norm-imaginary

I have written a code to Dot a row (conjugate of that) of mm to the next one: ...
5
votes
2answers
284 views

delete zero rows in a matrix

If there is a matrix with some of its rows equal to zero: (its zero rows are randomly distributed and does not have an ordered arrangement): same as: ...
1
vote
1answer
95 views

Orthogonalization is not commutative!

I get stuck into a problem: I am going to produce orthogonalized eigenvectors of a matrix and in any iteration. I shortened my question in the bellow line: Why do we face to different results of ...
4
votes
2answers
123 views

Reading from a file: complex number with small imaginary part

I'm trying to read a matrix from the next file: 1+1e-18i 24 42 23.43e-23i using u=Import["file.dat","Table"]; and then find, ...
2
votes
3answers
93 views

How to compare and remove x-coordinates (and the associated y-coordinates) that are less than previous x-coordinates?

I am using Mathematica version 9.0 and am trying to compare and remove x-coordinates, and the associated y-coordinate, that are less than previous x-coordinates. Below is an example using sample data. ...
1
vote
0answers
75 views

Simplest use of transpose given a vector and a matrix [closed]

Suppose that I have: x = {1, 1}/Norm[{1, 1}]; A = {{1, 2}, {2, 1}}; What is the simplest way of calculating $x^T A\ x$? And are there symbols on any of the ...
1
vote
1answer
69 views

Issue with Differentiation over a tensor

I am new user in Mathematica. I am working with liquid crystal theory, and one of the notation there is the tensor: $ \Pi_{ij} = \frac {\partial {F_{el}}} { \partial ( \partial {n_i} / \partial { ...
3
votes
1answer
52 views

Saving Dot-ed eigenvectors in a special comparison

We have produced a 4*4 matrix in any iteration containing nx from 0 to 2 by steps of 0.5. and in any iteration we have saved sorted orthogonalized-eigenvectors based on their eigenvalues with this ...
1
vote
0answers
111 views

MatrixExp of a complex matrix of size about 10000 by 10000 [closed]

I want to apply MatrixExp of a numerical, complex matrix of size about 10000 by 10000, and I also need high precision as I need to multiply several such matrices. ...
0
votes
0answers
56 views

Solving matrix optimization

I have the following problem. Let $X_1, X_2, \cdots, X_k$ are $n \times n$ Hermitian matrices (need not be positive) given. Let a $n \times n$ positive matrix $A$ is given such that $Tr(A.X_j)<0$ ...
8
votes
2answers
174 views

Difficulty using LUDecomposition

I'm having trouble using LUDecomposition with pivoting. I read the Mathematica help on this particular command, but I'm still lost. Take a matrix like: ...
7
votes
2answers
187 views

Why is mathematica eating a row from QRDecompostion

I'm attempting to calculate the QRDecomposition of the matrix: a= {{1,3},{0,5},{2,-8}} QRDecomposition [a] The answer mathematica gives me is: - Q which is a ...
1
vote
1answer
64 views

calculate relationship between cause and effect (rows/columns/delta etc.) on tableform

I tried to enter this Excel (on the right of the picture) information to program. following these codes has been used: ...
5
votes
1answer
100 views

Efficient upsampling of multidimensional array

I would like to efficiently upsample a multidimensional array. It's a 5000*5 matrix where each element is a submatrix 12*12 and it is that 12*12 matrix I want upsampled (to 24*24). The upsampling ...
1
vote
1answer
67 views

Pure “Select” function over matrix

I have several lists of tuples in the following shape: l1 = {{1, 134}, {2, 314}, {3, 164}} I do want to select, from each list, list elements fulfilling a ...
4
votes
2answers
112 views

Factor out the scalar multiplier for the dot product of 2x2 matrices

If yy and zz are 2x2 Hermitian matrices, is there a way that I can mark them (with a property?) as Hermitian so that Mathematica can assume that it can factor out and simplify scalar multipliers from ...
1
vote
1answer
61 views

Sort and Save Matrices Eigenvectors to a Larger Matrix

We are going to sort and save all orthoginalized-eigenvectors of 4*4 random matrices (produced in any iteration) to a larger matrix such as storagematrix. Since, produced random matrices are 4*4, ...
2
votes
0answers
86 views

Parallel evaluation of symbolic matrix eigenvalues

I'm trying to find eigenvalues of symbolic hermitian 40x40 block matrix. It is made from 20 2x2 matrices like this: ArrayFlatten[Table[M[m,n],{m,1,20},{n,1,20}]] ...
0
votes
1answer
102 views

Element assignment in matrix function

I have to define a function of two variables that yields a high dimensional matrix, with each entry containing a scalar function, that uses its coordinates in the matrix as input. like this: ...
1
vote
0answers
65 views

How do I diagonalize a matrix? [closed]

How do I diagonalize the following matrix: ...