Questions on the manipulation of matrices in Mathematica.

learn more… | top users | synonyms (1)

0
votes
1answer
118 views

Trouble carrying out symbolic operations on matrixes

I have some problems. First of all, I declare matrices like below ...
4
votes
1answer
279 views

How to construct this matrix fast?

I write a function which is a matrix as below: ...
5
votes
1answer
320 views

Matrix Rational Canonical Form

Is there a way to calculate the Rational Canonical Form of an $n\times n$ integer matrix using Mathematica? I have been perusing the documentation and web, but nothing so far.
7
votes
2answers
418 views

Is there any fast way to solve a quadratic matrix equation in Mathematica approximately?

Let the square nonsingular matrix $M$ is a given convergent matrix. What are the best scalar values for $\alpha$ and $\beta$ (in the real numbers domain), at which the following quadratic matrix ...
4
votes
2answers
174 views

Using two color functions in a MatrixPlot

I'm trying to use two color functions within one MatrixPlot in Mathematica. Is it possible to do this? For example, using a very simple matrix: ...
1
vote
3answers
201 views

Creating overlapped block matrices

I'm doing an FEM assignment using Mathematica. (EK1 = {{a11, a12}, {a21, a22}}) // MatrixForm (EK2 = {{b22, b23}, {b32, b33}}) // MatrixForm I don't know how ...
1
vote
2answers
262 views

How do I create matrices with arbitrary list restrictions?

I want to randomly generate a square matrix of dimension n with entries in the list StartingEntries, and also satisfying that for any such matrix M, the matrix Inverse[IdentityMatrix[n] - M] has ...
4
votes
4answers
252 views

Elegant Matrix Combinations

Suppose you have a matrix (mxn), simplified for illustration m= {{a, b, c}, {d, e, f}} And a set of combinations (simplified for illustration purposes but can ...
-2
votes
2answers
193 views

Mathematica not assigning variable correctly

So I have been fiddling with this the last hour and I just can't get it to work. I have 3 matrices of the same size which contain nothing but 0's in a list, I also have 3 matrices of the same size ...
4
votes
4answers
252 views

Generate Non-Singular Matrix of $n*n$ dimension

I want to create a function that will make an $n*n$ matrix which is non-singular that will always retrieve the same matrix (meaning that the matrix will not be random each time). I tried using the ...
1
vote
1answer
112 views

What is the best way to produce a symmetric semi-definite matrix using as few variables as possible?

As we know, there are only $\frac{n(n+1)}{2}$ variables in a symmetric $n$-dimensional semi-definite matrix. Is it possible to produce a $n$-dimensional semi-definite matrix whose trace is $1$ using ...
1
vote
2answers
256 views

Error using Solve on Matrix Multiplication

I am trying to make a function the will find that value of $x$ in the following equation: $x.a=b$ all values of $x, a, b$ are matrices. The dimensions of $x$ are unknown, but $a$ and $b$ have the ...
0
votes
0answers
54 views

Identify columns of a huge matrix just polynomially many rows chosen at random

I am interested in the following problem in combinatorics $\Cap$ Probability. Let $\lambda \in \mathbb{N}$ be a parameter. Consider a matrix of $2^\lambda$ rows and $2^\lambda$ columns. Each column ...
2
votes
2answers
613 views

How to generate a random matrix with specific parameters?

I want to use Mathematica to generate a random matrix with given dimensions, entries coming from a finite set, and with a determinant also coming from a finite set. (It's very important that the ...
24
votes
2answers
459 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 ...
8
votes
6answers
213 views

Custom Matrix product

I have a list: list1 = {{{a1, a2, a3}, {b1, b2, b3}}, {{c1, c2, c3}, {d1, d2, d3}}}; I want an operation that gives me: Is there a built-in way of doing ...
2
votes
2answers
367 views

Determinant of a large matrix and solution of a linear equation

I am trying to solve a linear equation in x, where the equation is given by Det[M]==0. The M is a symmetric matrix (dimensions 47x47) with an element equal to x and all other elements are equal to ...
1
vote
4answers
260 views

converting between forms - symbols/subscripts - matrix products

If I have a vector of the form (xp+y, x+yp) do you have a simple way of creating the following matrix and vector from it: {{p, 1}, {1, p}} * {x, y}, such that ...
4
votes
4answers
359 views

Listing matrices up to symmetry

I am interested in the equivalence relation on N x N binary matrices, in which two matrices are equivalent if one can be obtained by rotating/reflecting the other. I would like to obtain a list ...
8
votes
5answers
326 views

correct way to map a function on entries down the pages in a 3D matrix?

updated: added another method to the methods I tried below for completion. This is new way of doing it, but most likely not very efficient, did not time it I can only visualize 3D matrices in my ...
5
votes
4answers
184 views

Creating simple table

How do I create a table like this? I find it very hard to create the zero-row and zero-column. Edit: I am looking for a solution where a formula eg. Table or something else is being used. I can ...
2
votes
1answer
160 views

How to use adaptive precision in matrix computations?

I wish to compute the pseudo inverse of rectangular (or square) matrices by the cubically method of Chebyshev given by $X_{k+1}=X_k(3I-AX_k(3I-AX_k))$ where $X_0=\frac{1}{\|A\|_F^2}A^*$. The procedure ...
1
vote
1answer
153 views

Construct an infinte matrix with finite sub-matrices

How can I construct an infinite matrix with finite sub-matrices of the form A = (B0, 0, B1 0, B2, 0 0, 0, B3) where each Bi is a rectangular or a ...
1
vote
3answers
367 views

RowReduce for symbolic matrices

I'd like to invoke RowReduce on some matrices with a time parameter. For example consider A = {{1, 0}, {0, t}} If ...
7
votes
6answers
327 views

Assigning row of values to a lower triangular matrix

I want to assign a linear row of values to the elements of a lower triangular matrix, i.e., if the row of values is {1,2,3,4}, then the matrix (4 X 4) should be: ...
1
vote
2answers
335 views

Finding shortest non-zero vector $x$ satisfying $Ax=0 \pmod q$

Let $n$, $m$, and $q$ be positive integers (with $m > n$), and $A$ be a matrix over $\mathbb{Z}_q^{n \times m}$. Using Mathematica, I want to find the shortest non-zero vectors $x \in ...
2
votes
1answer
868 views

Having Problem with Importing Excel file to Mathematica Notebook?

I have solved some equations and exported the final results, which they are several Matrices, as a EXCEL file ( .Xls ). Now, I want to use these EXCEL files as my inputs to solve some other equations. ...
1
vote
1answer
158 views

Averaging multiple 2D data sets

I have multiple data sets, each of which is a 2D matrix. I want to construct a new 2D Matrix in which each element is the average of that element for all the original data sets. i.e ...
2
votes
2answers
368 views

Matrices and polynomials: MMA 8 vs. 9?

I want a function to take a polynomial from a list, plug a certain matrix T into that polynomial, and return the answer as another matrix. My program uses the applyPoly function suggested by a user in ...
3
votes
1answer
457 views

A rotation-like transform on a matrix

Do not be confused with comments, those are for previous version of the question - Kuba Imagine I have a matrix of the form: ...
3
votes
2answers
305 views

Optimization problem with matrix positivity constraints

Is it possible for Mathematica to parametrically find a local minimum of a given function (say of some variable $x$ where $(a,b,c)$ serve as parameters) subject to the constraint that a given ...
0
votes
1answer
420 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 ...
1
vote
1answer
130 views

Manipulate doesn't work for plotting a region where a matrix is positive semi-definite

I'm facing the following problem and would very much like you help. Thanks is advance! I have defined the following 4x4 matrix: \begin{equation} S=\left( \begin{array}{cccc} ...
0
votes
2answers
120 views

Create a Matrix out of two matrices

I have two matrices A = {{a1,a2},{b1,b2}} and B = {{x1,x2},{y1,y2}}. I would like to create out of these matrices a new matrix ...
2
votes
1answer
210 views

How to obtain a Symplectic 4×4 matrix?

I have a problem in obtaining a $2n \times 2n$ Symplectic matrix $T$, with $n=2$. I couldn't find a direct command in Mathematica to achieve this. Conditions: ...
1
vote
3answers
127 views

How can I threshold for a minimum value with MatrixPlot?

Looking at the Options for MatrixPlot, there doesn't seem to be a mechanism for lowerbound threshold - i.e. ignoring values that ...
0
votes
2answers
154 views

Taking averages at certain intervals

I am trying to take averages of a large two dimensional array at certain intervals. For example, for the first row, I want to take K averages of 500 values. Here is what I am trying ...
3
votes
2answers
552 views

Importing data into an array, column by column

I'm building a large matrix having different sized rows consisting of a few columns. The different columns are imported .txt files. Why can't I build the matrix column by column? For example, I ...
4
votes
5answers
196 views

Creation of one column matrix

I want to create an one column matrix with the 1st element to be -1, and all the other elements to be zero. However, I want to be able to make a matrix of this kind with arbitrary dimension, that is, ...
0
votes
2answers
96 views

How can I adjust matrices into the same ItemSize and aligned well in Notebook?

I typed three matrices, but they are not aligned well, and the Items in one matrix are also not aligned well and with differenct ...
1
vote
1answer
95 views

sequence of matrix multiplications

My linear algebra book has questions that are are marked to use math software. There's probably some $50 guide on how to do everything but usually documentation has gotten me through. I've been kind ...
0
votes
1answer
119 views

Sorting a list of triplets by first element of each triplet fails

In the last line of code, I´m trying to order the matrix by the first column. I want to store in the Array t2tlistsorted ( 100 x 3 ), but I can´t. ...
11
votes
3answers
859 views

How can I visualize 6 square matrices as a cube?

I have six square matrices of the same dimensions in a list, for example: ...
0
votes
1answer
69 views

Basic Row Traversal Question

Right now I'm using this For loop to do an operation to each row of a $n \times n$ matrix, I was trying to figure out how to do this with ...
0
votes
1answer
114 views

Finite precision - how to get rid of “near zeros” [duplicate]

I am performing a finite-precision operation on a matrix A which I know precisely; call the result B. The operation is taking ...
1
vote
2answers
170 views

Need an efficient method for finding certain matrices

I am trying to write a function which produces square matrices with certain characteristics. The function should have two inputs: number of the rows, n number of ...
4
votes
3answers
179 views

Output to preserve dot product

I am fairly new to Mathematica and I am faced with a problem. I tried to search for the solution but it seems that I don't know how to formulate the short search request. I need to perform a matrix ...
0
votes
0answers
34 views

Eigenvalues for large matrices without Root-Solution [duplicate]

I read some other questions and tried to implement the given answers but yet, I did not succeed to find proper solutions for my eigenvalues. I hope someone can show me how to do this for this case, ...
1
vote
0answers
85 views

NMaximize with matrix input

I defined function f[x_, fixed_] := {...}. Here x is an $M\times N$ matrix. I want to maximize $f$ with respect to $x$. I have ...
1
vote
1answer
173 views

Hermite Normal Form in “columns” convention

After describing the Hermite Normal Form (HNF), MathWorld explains: The Hermite normal form for integer matrices is implemented in Mathematica as ...