Questions on the manipulation of matrices in Mathematica.
1
vote
0answers
170 views
Can mathematica simplify an expression setting simplified answer equal to zero?
Basically I want to reduce something like:
Subscript[P, 4] - Subscript[P, 5] == Subscript[R, 4, 5]* Subscript[i, 4, 5]
when only one of them is known (...
0
votes
2answers
325 views
How to calculate FDCT
I'm new to Mathemtica and I'm trying to calculate Discrete Cosine Transformation FDCT. I found the FourierDCT built-in function, but not DCT, so I need to implement it. I have tried couple of ideas ...
1
vote
1answer
300 views
Calculating an exact orthogonal modal matrix in Mathematica
I can calculate the modal matrix of a matrix A using the command JordanDecomposition[A][[1]], and a decimal approximation of the orthogonal (or normalised) modal ...
1
vote
2answers
173 views
How to extract RGB arguments as a list
Although the following lines of code work fine they are very awkward.
My questions are below
a = RGBColor[1, 0, 0]
b = RGBColor[0, 1, 0]
Is there a more compact ...
4
votes
1answer
124 views
Printing Block Matrices
I have a 2D matrix, such as:
d=2;
M=Array[a, {d^2,d^2}];
and I would like to print it in a way which emphasizes its dxd block matrix structure. If ...
5
votes
2answers
793 views
Eigenvalue / Eigenvector Calculation
I'm currently trying to compute the three smallest eigenvectors for a 34 by 34 matrix. While I was expecting this to take some time, Mathematica has been running for the past 3 hours, which seems ...
2
votes
5answers
120 views
Test First row of matrix
What is a good way to test the first row of a Matrix to check if one of the values equal a value. For instance, In this example, I want to get vector in the second row that has the bigger value in the ...
2
votes
2answers
295 views
Total Variation Distance of probability matrix
How can I calculate the Total Variation Distance of a transition Matrix? is there any built in function? I've searched all documentation and haven;t found anything.
** More information:
Let me try ...
3
votes
2answers
266 views
Loop and do operations on Matrix, then graph the results
I'm trying to do some operations to a matrix in a loop, and then I want to graph the results.
The results are pair of numbers.
Can I store the results of each iteration on "something" and the use ...
4
votes
2answers
160 views
Transform x-scale of data for e.g. MatrixPlot
I have to transform in a nonlinear way the x-scale of some data for a MatrixPlot (or ReliefImage or ...
2
votes
1answer
126 views
Numerical comparisons of matrices
I have a matrix which should be equal to a null matrix. However due to the numerical precision, a brutal equality test with a matrix initialized with zeros does not work.
How should I perform the ...
3
votes
1answer
385 views
stationary distribution of a transition matrix
How can I solve the stationary distribution of a finite Markov Chain? In other words, how can I estimate the eigenvectors of a transition matrix?
4
votes
1answer
435 views
Mathematica won't give eigenvectors but Wolfram Alpha will? What am I doing wrong?
If I ask Mathematica to find the eigenvectors and eigenvalues of the matrix:
...
1
vote
1answer
397 views
Creating a random normal matrix
I would like to create a random matrix with the constraint that the matrix must be normal, i.e. the matrix and its Hermitian conjugate must commute. I would create a random matrix "without ...
12
votes
4answers
282 views
Inputting a big structured matrix in Mathematica
Hi this is my first post and this is a problem that has bothered me a lot.
Suppose we have the $2012\times2012$ square matrix:
...
12
votes
1answer
255 views
How to extract and replace submatrix of a doubly-periodic matrix?
How can I effectively extract and replace a rectangular subpart of a toroidal matrix, i.e. one where boundaries are connected at opposite ends? Since the submatrix can overhang the edges, a simple ...
2
votes
3answers
407 views
Finding eigenvalues of a $1500\times1500$ matrix
I need to find the eigenvalues of a $1500\times1500$ real symmetric matrix given by $A_{i,i+1}= A_{i+1,i}=-1$ and also $A_{1,N=1500}=-1$ (this is because of a periodic boundary condition used) and all ...
10
votes
2answers
188 views
How can I compute the representation matrices of a point group under given basis functions?
Take the $C_{3v}$ point group for example:
...
4
votes
4answers
917 views
How to convert equation to vector (matrix) form?
How can I convert expression a1*u1+a2*u2+a3*u3 to the vector form of dot product A.U, where ...
17
votes
4answers
735 views
Why does MatrixForm affect calculations?
This is a really newbie question, but it has me confused. Why does this code work without // MatrixForm and doesn't work with ...
9
votes
2answers
897 views
How to get Matlab data imported with the same dimensions?
I have some Matlab image data with the following dimensions (output is from Matlab):
>> size(im)
ans =
86 86 3 45
The data imports just fine ...
14
votes
3answers
646 views
Mathematica for linear algebra course?
I'm taking a linear algebra / matrix theory course and we are free to use any software we want, and will be "expected to use MATLAB or an equivalent" for homework. The professor and textbook (Applied ...
1
vote
1answer
299 views
Is Mathematica matrix multiplication with its inverse wrong? [duplicate]
Possible Duplicate:
Why don't * and ^ work as I expected on matrices?
When I enter this
...
1
vote
2answers
291 views
How to Solve or LinearSolve $A = I$ matrix equation?
I'd like to solve this equation for $A = B$ where $B = I$, which represents 3 systems of 3 linear equations, for $a, b, c, d, e, f$, without writing LinearSolve 3 ...
3
votes
4answers
121 views
Pack Solve results into a vector
I am currently using a really easy function to get the eigenvectors of a corresponding eigenspace:
...
0
votes
3answers
166 views
Constructing a list with a Module [closed]
I have build this simple module trying to construct a matrix via Table
...
9
votes
3answers
515 views
Correcting a correlation matrix to be positive semidefinite
Does Mathematica have a way to "fix" a correlation matrix that is not positive semi-definite?
I looked through the documentation and search the internet but could not find anything.
6
votes
1answer
237 views
How to turn a random graph into a matrix
I have constructed a random graph with Mathematica using the RandomGraph command. Now I would like to convert this graph to a matrix, but I don't know how. The ...
1
vote
2answers
178 views
Symbolically associate vectors and their norms
I am wondering how to handle the following situation: I do have vectors of known dimension that I would like to handle symbolically. I suppose I can do something like
...
4
votes
2answers
125 views
Standardizing a coset table via matrix manipulation
Suppose we have a group $G$ and a subgroup $H$. A coset table encodes the permutation representation of $G$ on the right cosets of $H$. When we want to use these coset tables in calculations, it is ...
5
votes
4answers
322 views
Swap two entries in a matrix
Is there a nice, simple script one can use to swap two entires in a matrix? For example, suppose we have the matrix below:
$A=\begin{pmatrix}2 & 4 & 1\\
3 & 1 & 2\\
4 & 3 & 1
...
7
votes
1answer
222 views
Efficiently Constructing Rank One Approximations for a Matrix using SVD
Suppose I have a $m\times n$ matrix $A$ (real for simplicity). Then SingularValueDecomposition[A] yields 3 matrices $U$, $\Sigma$ and $V$ such that
$A = U\Sigma ...
1
vote
1answer
154 views
How do I use a matrix that has a variable?
I seem to be getting an error whenever I try running this piece of code.
Matrix12[n_] := {{1, 0}, {0, {\[Kappa]1[n]}/{\[Kappa]2[n]}}}
I've already defined the ...
2
votes
3answers
561 views
6
votes
1answer
343 views
Finding the characteristic polynomial of a matrix modulus n
Given a square matrix, is it possible to calculate its characteristic polynomial modulo n?
Unfortunately, this function ...
18
votes
2answers
942 views
Cycles of length N in a graph
If I have an undirected graph represented with an adjacency matrix, how can I find all the subgraphs which are a cycle of length N?
I don't really know the math nor the programming language well, so ...
4
votes
4answers
266 views
Prepend 0 to sublists
My question is similar to this one, but my goal is to prepend a single 0 the each sublist, not incrementally many 0's.
The file I'm working is a CSV containing around 50K sublists of length 35.
I've ...
10
votes
5answers
890 views
Best way to create symmetric matrices
From time to time I need to generate symmetric matrices with relatively expensive cost of element evaluation. Most frequently these are Gram matrices where elements are $L_2$ dot products. Here are ...
2
votes
2answers
534 views
Matrix multiplication in Block Form symbolic calculation by Mathematica
I have a problem which requires taking product of two $10\times10$ matrices. I would like to do it by considering both matrices as $5\times5$ matrices such that each entry of both matrices is actually ...
12
votes
4answers
305 views
How do you decompose a polynomial matrix into its matrix coefficients?
Let's say I have a matrix, $\mathbf{M}$, that is polynomially dependent on a single variable, such as
M = {{15 + a^2, a + 5 a^2}, {a - 5 a^2, 2}}
and I want to ...
13
votes
3answers
436 views
Constructing a symbolic Hermitian matrix
I need to construct a symbolic Hermitian matrix like
m = {
{ n, a, b, b},
{Conjugate[a], n, b, b},
...
}
but I am not able to set ...
4
votes
1answer
354 views
Computing Slater determinants
I need to compute Slater determinants. I'm wondering if I would benefit from assigning each of my functions to a variable prior to computation. I'm working with Slater determinants, but my question ...
3
votes
2answers
240 views
A dot appearing after a zero, and making the entries of a matrix into fractions
For more info about the difference between 0. and 0
I am a self-taught Mathematica user and I have some elementary questions-- perhaps too elementary for this site, but here they are.
If ...
27
votes
6answers
1k views
How to visualize/edit a big matrix as a table?
Is it possible to visualize/edit a big matrix as a table ? I often end up exporting/copying big tables to Excel for seeing them, but I would prefer to stay in Mathematica and have a similar view as in ...
30
votes
6answers
4k views
Elegant operations on matrix rows and columns
Question
The Mathematica tutorial has a section 'Basic Matrix Operations', describing operations like transpose, inverse and determinant. These operations all work on entire matrices. I am missing a ...
4
votes
1answer
384 views
exporting list of matrices in mathematica
I am working on some problem which requires generating a list of random matrices. So I used the code (actually a shortened version of the code, but it does not matter)
...
28
votes
2answers
592 views
Tiling a square
I wondered if there was a way to automate the process of finding a way to tile a tile into a square.
The idea is to represent the tile with a matrix of 0s for blank space and 1s for filled spaces ...
3
votes
2answers
561 views
How to substitute numeric values in a symbolic Jacobian matrix?
I have a multi-variate function from $\mathbb{R}^n\to\mathbb{R}^n$. Choosing any desired initial vector, we can produce the corresponding function value, which is a vector as follows. The main problem ...
5
votes
1answer
500 views
Is it possible to substitute tick labels with alternative text? [duplicate]
Possible Duplicate:
Labelling ArrayPlot Charts
I am making a MatrixPlot. For example, consider the following:
...
2
votes
1answer
158 views
Different determinants on 2 different computers
Is there any way to force Det to do itself in a certain way?
I've been running the same notebook on 2 differents computer, one MacOSX Lion and one W7 (both 32bit) ...


