Questions tagged [matrix]

Questions on the manipulation of matrices in Mathematica.

Filter by
Sorted by
Tagged with
0
votes
0answers
19 views

Matrices of Machine- or Arbitrary-Precision Real Numbers Error While Using Arnoldi for Large Sparse Matrix

I'm trying to use the built in Arnoldi method in Mathematica to compute the first 1440 eigenvalues of a large sparse matrix. After importing ...
2
votes
3answers
44 views

Find minimum with matrix positive-definiteness constraint

Say I wish to find the minimum value of the determinant of a symmetric matrix under the condition that the matrix be positive definite. So I attempt: ...
0
votes
0answers
53 views

Sum all the elements of a column

I have created the matrix m and I am not able to sum all the elements. {1, 2, 3, 4} would give 10 for example. Can anybody help? Best,
1
vote
0answers
27 views

Errors in NDSolve for complex matrices

This is the problem. It is quite simple, and looks unwieldy only because I had to rewrite quaternions as complex matrices. ...
1
vote
0answers
44 views

$ x $ and $ y $ coordinates in ListLinePlot [closed]

I'm trying to make a ListLinePlot with my randomly generated data, and I want one vector to be the x coordinates of the graph, ...
5
votes
2answers
80 views

Apply Outer to list of matrices and vectors

I have a list, M, of square $ n \times n $ matrices, {M1, M2, M3, ...}, and a list, V, of $ ...
4
votes
2answers
178 views

Create a matrix from the rows of another, and calculate the rank of the new matrix

This may be a very basic question, so apologies in advance, I'm a first-time Mathematica & StackExchange user! I have a 7x3 matrix X with all rows being unique in a 2D-list format. For example:...
1
vote
0answers
63 views

How to use MatrixPlot as a DensityPlot?

I have a 1000x1000 matrix the MatrixPlot of which gives this graph: The code is ...
1
vote
1answer
65 views

Cryptic NDSolve::nlnum when working with matrices

This problem was initially formulated in quaternions, but I had to rewrite them to complex matrices (as they seem to be supported better). Possibly introducing some errors along the way. So the ...
3
votes
1answer
79 views

Diagonalizing a symbolic matrix

I am trying to diagonalize the following matrix \begin{equation} \left(\begin{array}{cccc} { \frac{1-K\left(x_{2}^{2}+x_{3}^{2}\right)}{1-K|x|^{2}}} & { \frac{K x_{1} x_{2}}{1-K |x|^{2} }} & { ...
1
vote
1answer
39 views

The Matrix formula of this hamilton is different from that found in the paper

I am trying to rewrite the following Hamiltonian in the matrix form, but I get different results. In this article, the Hamiltonian that represents a three-qubit Heisenberg spin chain and its matrix ...
1
vote
1answer
66 views

Efficient way to evaluate numerically product sines functions

I'm trying to perform integration of the following matrix. ...
2
votes
0answers
72 views

What's a quick test to see if an $n \times n$ matrix is diagonal and/or proporitional to the identity matrix? [closed]

As the title indicates, I want to test whether an $n \times n$ matrix (numeric, symbolic,..) is diagonal and/or proportional to the $n \times n$ identity matrix. I, of course, can test whether the $n^...
3
votes
1answer
58 views

Is this a correct implementation of the principal-leading-minors test for positive-semidefiniteness?

I am asking this question in response to comments by mikado and Daniel Lichtblau on my question Maximize a six-dimensional function subject to joint positive-semidefiniteness constraints I gave two ...
0
votes
1answer
73 views

Maximize a six-dimensional function subject to joint positive-semidefiniteness constraints

I want to maximize Abs[a1 b1] + Abs[a2 b2] + Abs[a3 b3] subject to the joint constraints ...
2
votes
1answer
82 views

Building matrices of 0’s and 1’s

How would I go about computing the number of ways an nxn matrix of 1’s and 0’s can be made such that every nxm submatrix has more rows containing 1’s than the number of columns m?
2
votes
0answers
84 views

Converting complex equations to matrix form

My question is a continuation of the topic: How to convert equation to vector (matrix) form? It is necessary to separate the components of equations into vectors and matrices and a combination of ...
7
votes
3answers
299 views

How to eliminate rows and columns of matrices?

I would like to create an operation that checks if the elements of the row are 0 and eliminate the respective row and column associated with the row matrix. If if the lines have at least one non-zero ...
0
votes
1answer
47 views

How to update all values of a matrix with a multiple of their existing values

I have a matrix, and I want to multiply all the values in each element by Sqrt[2/3]. Here is the code. ...
6
votes
4answers
341 views

How to use genetic algorithm to calculate the maximum value of this matrix

1-9 the 9 numbers are arranged into 3 * 3 matrix without repetition.How to select the matrix with the largest determinant value: ...
5
votes
2answers
143 views

Enumerating $4 \times 4$ matrices satisfying parity constraints

I've encountered a problem, which requires computer aid, but it seems a little above my Mathematica prowess because it requires counting objects satisfying some simple conditions. It seems doable, ...
1
vote
3answers
84 views

Create a new matrix from an existing matrix and then plot it

I have some code will test an equation and finds values for (n,j,k,l) in which the expression is true and puts them in the matrix - here is the code. ...
1
vote
0answers
22 views

Is there any relation between index of matirx AB and matrices A, B? [migrated]

index of matrix A is the smallest nonnegative integer k such that rank(Ak+1)=rank(Ak) now i want to know which relation is between Index(AB) and Index(A), Index(B)?
1
vote
1answer
44 views

How to feed a list of disks to RegionUnion

I have a bit of code which creates a list of disks (I'm exploring Gershgorin circles) based on a matrix tm. ...
4
votes
1answer
483 views

Is this a bug or my mistake?

This: Graph[{1 \[DirectedEdge] 2, 2 \[DirectedEdge] 3, 4 \[DirectedEdge] 1}] AdjacencyMatrix[%] // MatrixForm generates: But, this ...
3
votes
2answers
96 views

How can I map edgeweights from a matrix onto edges along the paths generated by another matrix

Suppose that we have two matrices with identical dimensions: matA and matB. I want to identify a set of pathways using ...
2
votes
1answer
64 views

How to automize Shannon's Entropy calculation using a MM function

With the following code, I calculate Shannon's Entropy function HH1 for a given matrix mat. ...
3
votes
2answers
115 views

How do I make this Solve work faster?

I'm quite new to Mathematica and this code is taking forever to work. Are there easy ways that will make this same code work much more quickly? ...
3
votes
2answers
74 views

Fixed point of a vector

It seems to me that FixedPoint is designed to work with a particular value, but what if we want it to operate on a vector instead? I start with an nxn matrix mat and the function: ...
8
votes
3answers
356 views

How can I get all 4 × 4 submatrices of an n × n matrix?

I have a square matrix, I need to extract all possible combinations of 4 × 4 submatrices, where $n > 4$. For example in the case of a 6 × 6 matrix, there are 15 4 × 4 submatrices. I need the list ...
5
votes
2answers
344 views

How to reduce the λ-matrix to Smith Standard Form

A = {{1 - λ, 2 λ - 1, λ}, {λ, λ^2, -λ}, {1 + λ^2, λ^3 + λ - 1, -λ^2}} How to reduce the above λ-matrix to the following Smith standard form: ...
1
vote
0answers
48 views

Find vectors describing two interconnected pyramids in Euclidean space

I need the help of competent linear algebra specialists in Mathematica. In the Euclidean space, two tetrahedrons are turned at different angles. Their vertices coincide with the beginning of the base ...
1
vote
1answer
34 views

Exporting column vector as matrix in latex via “Copy as” doesn't always work. Example with vector

I want the simplest way of exporting matrices, and vector from mathematica to Latex. Usually, I display my matrices in MatrixForm and copy as Latex to paste in my latex document. However it seems it ...
4
votes
3answers
128 views

Cell-adjacency Graph of a Square Mesh

Consider the list of points pts = {{1, 1}, {1, 2}, {2, 1}, {2, 2}} I want to use them to define a 2x2 square mesh using ...
1
vote
2answers
58 views

Keep important eigenvectors according to the important eigenvalues except one unimportant eigenvalue

I have an iteration whose steps extract a matrix with any possible dimension for example 3*3, 6*6, ...
4
votes
1answer
229 views

Adjacency Matrix of Sierprinski matrix

how can i make adjacency matrix of sierprinski graphs?
0
votes
2answers
75 views

Nested For Do Table cycle problems

I got England and German soccer data with the following: ...
2
votes
1answer
44 views

Inverse of matrix up to some order

Let $A(t,s)$ be a matrix of any size (potentially large), whose entries are polynomials functions wrt $(t,s)$ of order $N$. I would like to compute the inverse $X$ of $A$ up to the order $N$ that is $...
0
votes
1answer
30 views

How can I use a matrix element to plot with ParametricPlot? [closed]

This is a completely simplified example to demonstrate the issue. I have a matrix, it contains an uninitialized variable. I need to extract that element of the matrix and use in to plot a parametric ...
2
votes
2answers
97 views

Is there any faster alternative for matrix exponential?

Lets define matrix $M$ as ...
6
votes
4answers
356 views

How can I generate random matrices with certain requirements for the entries?

I would like to generate random 9x9 matrices, which contain only the digits 1-9, each one appearing exactly ...
1
vote
1answer
94 views

Solving the matrix quadratic equation: A.X.X + B.X + C == 0 analytically

I'm having difficulty figuring out how to solve a matrix quadratic of the form, $AXX + BX = -C$ analytically for $X$. Where $A$, $X$, $B$, and $C$ are $N \times N$ matrices. I tried using ...
0
votes
2answers
103 views

How can I transform my calculation into a function?

I have written the following code, which serves my purpose. However, I like to have a Mathematica function such as ...
0
votes
0answers
38 views

Finding the Eigenvalues for big matrices

To start I have the following matrix (not so big) I want to find the Eigenvalues in terms of kx and ky. I tried to use the classical ...
3
votes
3answers
239 views

How to join many tables side by side?

I have function for table $t$ t[n_] := Table[i*n, {i, 1, 3}]; For example t[1]=(1, 2, 3), t[2]=(2, 4, 6), and t[3]=(3, 6, 9) To join $n=3$ tables side by side ...
1
vote
1answer
56 views

How to use Collect in Mathematica [closed]

For an input $n$, I have $n^2$ variables uu[1,1],...uu[1,n],...,[n,1],...,uu[n,n]. I have an equation that is linear in these (e.g. ...
1
vote
1answer
57 views

How to “undo” an outer product

I have a matrix which is formed from the outer product of two complex vectors. There is some noise as well. How can I get the best estimate of the complex vector? Here is a case without noise for a ...
3
votes
2answers
100 views

Print command in matrices to generate inactive numbers

I would like to generate a matrix with elements that come from a print command and are numbers and then multiply the first matrix by another one, element by element. However, I would like the ...
4
votes
3answers
429 views

Generating all 2x2 matrices with entries from 0 to 3 whose det is 1 with mod 2 arithmetic

I am trying to make a list of 2x2 matrices whose entries are all possible permutations of 0,1,2 and det=1 mod 2 arithmetic. First I tried to create a Table like this ...
0
votes
1answer
33 views

How to make a tensor product into matrix?

TensorProduct[PauliMatrix[1], DiagonalMatrix[{1, 1}]] // TableForm created a tensor, which could be flatten to table form. However, how to make the tensor into a ...

1 2 3 4 5 49