Questions on the manipulation of matrices in Mathematica.

learn more… | top users | synonyms (1)

3
votes
0answers
50 views

FindInstance of Matrices

I'm trying to use FindInstance to find examples of matrices that complete an expression. However, it seems like I need to specify atomics as my variables to the function. So, here's a really simple ...
0
votes
0answers
52 views

Can't operate on vector within a list of rules

I'm trying to set up a list of rules which includes the following: ...
0
votes
0answers
47 views

LatticeReduce question

Does LatticeReduce work with arbitrary precision arithmetic? That is, if I give it a linearly independent integer basis, but the integers are 40 decimal digits long ...
6
votes
2answers
152 views
3
votes
1answer
120 views

FindMaximum “is not a real number at” nrnum problem

I'm experiencing a problem using FindMaximum that I don't understand (due to my newbie knowledge of Mathematica's syntax). That is, FindMaximum sometimes returns a (correct) answer, but sometimes ...
0
votes
1answer
91 views

Generate random Hermitian matrices [duplicate]

I want to generate random Hermitian matrices. For now, random Hermitian matrices with size 2 are obvious to construct. But elegant methods for higher dimension would be nice! Are there methods besides ...
0
votes
0answers
34 views

Handling a matrix with components greater than machine precision

I have four quantities stemming from a 4th order differential equation. I can represent these as a vector which is a product of a 4X4 matrix $$ M=\left\{v,\frac{\partial v}{\partial x},\frac{\partial ...
6
votes
2answers
71 views

A problem about matrix/vector extension via $\tt ArrayPad$

Given that I have a vector and matrix as follow: vec = Array[Subscript["P", #] &, 6, 0]; mat = Array[Subscript["P", #1, #2] &, {5, 4}, {0, 0}]; And I ...
2
votes
1answer
59 views

Eigenvalues are not the same in the special case

I have this matrix: h = { {e1, 2, x}, {2, 2, x}, {x, x, 2} }; I want to calculate the eigenvalues and then set x equal to zero: ...
6
votes
1answer
68 views

Matrix Multiplication after “Flatten”

Say we originally had two matrices, $A$ and $B$, both $n \times n$, whose product $$ C= A.B $$ Now I flatten $A$. I can obtain a flatten $C$, from the following multiplication $$ ...
6
votes
1answer
120 views

List consisting of positions of the matrix elements and the elements themselves

Given a 2D matrix I would like to make a list with elements consisting of positions of the matrix elements and the elements themselves. Let the matrix be ...
3
votes
3answers
118 views

How can I make custom accumulated sequences like the following?

First of all, I don't really know how to formulate the question, so if you understand my question and know a better way to phrase it, please revise. I have the following Matrixes: ...
2
votes
3answers
76 views

How can I create a dynamic Matrix inside a function?

I have a function where a n parameter is handed and a list of values is calculated inside of it. I then need to solve a linear system of equations that require me ...
3
votes
1answer
67 views

How to multiply a row to multiple rows in a matrix

I have the Following Matrixes; ...
0
votes
1answer
102 views

Precision of Eigensystem? [closed]

I was using Eigensystem to obtain the rotation matrix. However, I find out Mathematica does not fully diagonalize my matrix (or say not precise enough). My matrix ...
1
vote
1answer
97 views

Visualizing Matrix that represents a network

I have a nxn matrix $A$ that represents a network. I have $n$ nodes in the network, and the matrix $A$ represents the number of connection (edges) between the different nodes. For example, if $A$=0, ...
0
votes
1answer
65 views

errors in simple for loops

Im trying to run the following code, which I have translated from Matlab. I created a for loop nested inside another for loop. mW is a matrix, and ...
0
votes
1answer
45 views

Output of Coefficientrules into Jacobian matrix

I have a pair of large polynomials in u, v, a1...a9 and b1...b9, generated by ...
0
votes
2answers
48 views

Enlarge a matrix and fill in zeros [closed]

Suppose I have a dynamically generated 4-dimensional matrix L in the shape shape={d1, d2,d3,d4}, and ...
0
votes
1answer
41 views

Tolerance of PositiveSemidefiniteMatrixQ [closed]

I believe the following should be True but returns False for me: ...
2
votes
2answers
69 views

Reliably computing the signature of a matrix with small eigenvalues

When asked to compute the eigenvalues of the following matrix ...
4
votes
2answers
138 views

Extract part of a matrix

I have imported a matrix from a .txt file (it could be better from an Excel file): ...
4
votes
1answer
190 views

how can i associate the headings of columns/rows with content of itself and then recall what i want after i've imported the excel file in mathematica

Hello, i make another try... I have to import a file like this below (it is an excel file, i show you just the beginnig. it should have thousend of rows and columns). After i've imported the file i ...
2
votes
1answer
55 views

Interpret hexadecimal sequence as a binary matrix that can be used in AdjacencyGraph

I have a database of hex sequences stored as blob. Each of them is a binary matrix representing the adjacency matrix of a directed graph. I want to use the ...
1
vote
0answers
58 views

Calculating in the group ring $Q[GL_n(Z)]$

I am trying to use Mathematica to check some identities in the group ring $Q[GL_n(Z)]$. Is there a package/function of Mathematica to do this? Thanks a lot in advance!
4
votes
3answers
169 views

How to plot real roots of complex polynomials avoiding branch cuts?

Lets say I have the following matrix: M={{1,3+E^(I x),-1+2I x},{3+E^(-I x),2,E^(3I x)},{-1-2I x,E^(-3I x),-2}}; $$ M=\begin{pmatrix} 1& 3+\mathrm e^{ix} ...
3
votes
2answers
127 views

Take a specific part of a matrix imported from a .xls

i would like to know if there are any ways to link headings of a table i had imported with the data in the table itself. I imported a matrix from an excel file and i want to take a specific part of ...
15
votes
5answers
547 views

A quicker than outer

I need to get a matrix $\{a(x_i-x_j)\}$, where $x_i$ form a partition of an interval, $a(x)$ is a given function. I use ...
-1
votes
1answer
88 views

Is it possible to colour only one column of a matrix? [closed]

I was wondering if it's possible to colour a column or a row in a matrix. For example is it possible to add colour for one of the rows/columns of the following matrixform code? ...
2
votes
5answers
376 views

Create a Pascal Matrix

I am trying to write a function that can create a Pascal matrix. So far I have ...
4
votes
1answer
62 views

Building a matrix in block matrix format

Now, I'm aware of the threads existing about this question such as: How to enter matrices in block matrix format? How to form a block-diagonal Matrix from a list of matrices? But I wasn't able to ...
1
vote
0answers
62 views

Exponential Matrix Diffentiation

I have been struggling with the following question while solving an optimization problem in $\mathbb{R}_{+}^G$. Basically, I have $$\min_{y \in \mathbb{R}_{+}^G} F(y) = y^{T}\mathcal{K} + \exp(-y^{T} ...
1
vote
2answers
95 views

Finding matrix given null space

Suppose I input a very large $n$ integer vectors and I wish to compute the matrix whose nullspace is spanned uniquely by these vectors. Is there an appropriate command/module to do this using ...
0
votes
1answer
64 views

How to merge 2 columnar matrices into a row matrix? [duplicate]

if i have two columnar matrices A,B . then how can i merge both matrices into a row matrix. ...
1
vote
1answer
60 views

Count and NMinimize don't seem to work together

Initially I write down a 2x2 unitary (Uni) , make a tensor product 4 times (LocalUni) and apply it to an initial numerical matrix Rho, to obtain RhoLU, that depends on 12 parameters. This is my code: ...
0
votes
0answers
41 views

How to combine two matrices.? [duplicate]

let A, B are any 4 by 2 Matrices , i want to know whether it is possible to obtain a 4 by 4 matrix by using equation A=B Thanks in advance
2
votes
3answers
48 views

Assigning sections of a matrix to lists based on row value

I'm working with a very large (4x41355) matrix and I'm trying to make lists out of sections of rows based on the value in the fourth row. It's like this: ...
10
votes
0answers
101 views

Efficient solution of huge sparse linear system

I'm trying to improve efficiency of my code in which main task is a solution to huge (~$10^4\times 10^4$) but sparse linear system $$Ax=b$$ (In fact my aim is to solve nonlinear equations $F(x)=0$, ...
0
votes
1answer
127 views

Getting mathematica to factor out constants and apply euler's identity to a table

I'm doing some quantum mechanics homework that I'm going to eventually generalize to higher spin states, so the solutions are going to need to be decently independent of the dimensions of the table ...
2
votes
2answers
85 views

Merge two trees into a rectangular matrix in Mathematica

How can I merge two trees, t and s, so as to form a square matrix below, where both trees starts from top-left (as shown), and ...
18
votes
2answers
201 views

Speeding up generation of block diagonal matrix

I'm struggling with the following problem. I have $48$ square matrices (full, filled with real machine precision numbers, thus are packed, all different) of size $128$. I wolud like to place them on a ...
10
votes
7answers
261 views

Extract left-upper triangular data from a square matrix-form list

Hopefully, this question is not too basic or obscure. I'd like an idea on how to extract this {{1}, {5, 2}, {9, 6, 3}, {13, 10, 7, 4}} from ...
4
votes
0answers
50 views

How to transform a tree-form list to matrix-form list in Mathematica? [closed]

Excuse my naive question. Is there a quick/efficient way to transform {{1}, {1, 2}, {1, 2, 3}, {1, 2, 3, 4}} to a lower-triangular matrix-form ...
1
vote
0answers
50 views

Mapping over two indices with a condition

How can I use Map over two indices with a condition? I am trying to calculate second derivative of an eigenvalue, $\lambda_i(x)$, of $n \times n$ matrix $M(x)$ ...
4
votes
1answer
74 views

How do I put matrices next to each other? [duplicate]

So I want to be able to put matrices "next to each other", or in other words if I have two matrices $A$ that is $n\times k$ and $B$ that is $n\times m$, I want to be able to create a matrix $C$ that ...
2
votes
1answer
161 views

Simple code to write differential equations in a matrix formulation

Is there a simple code to transform the following differential system equations : ...
2
votes
2answers
72 views

Problem with ArrayFlatten to concatenate matrix

I would like to concatenate 2 matrix : - the first which is a line of 2 elements - the second which is a matrix of 2-2 elements I use the following code : ...
7
votes
1answer
91 views

Count degrees of freedom of a polynomial

I want to count the independent degrees of freedom of a polynomial in three variables $(z_0,z_1,z_2)$. Therefore I take the coefficients of $f$ and compute the rank Jacobian with respect to the ...
4
votes
2answers
141 views

How to be more efficient/faster with this MatrixExp-vector multiplication?

I am looking for expertise that helps to improve speed of the code below. First, a little bit of background: There is some system of differential equations $\dot{\vec{m}}(t)=S(t)\vec{m}(t)$. In order ...