Questions on the manipulation of matrices in Mathematica.

learn more… | top users | synonyms (1)

2
votes
3answers
145 views

How to find the kth largest eigenvalue of a matrix, taking into account the sign? [duplicate]

I have a real symmetric matrix m (i.e. its eigenvalues are all real). Eigenvalues[m, {k}] will find the ...
0
votes
1answer
62 views

How to add an extra column to a current matrix (list)? [duplicate]

a = {{-800, 1712}, {-801, 1713}, {-806, 1832}} TableForm[a] b = a[[All, 2]] - Min[a[[All, 2]]] How do I make a new matrix (list) whic looks like this ...
1
vote
2answers
107 views

Get inverse of a matrix step-by-step [duplicate]

How can I get the inverse of a matrix step by step? An example: Given the matrix {{8, 2}, {3, 2}}, the result is {{$\frac{1}{5}$, -$\frac{1}{5}$}, ...
1
vote
1answer
77 views

Correlation to Covariance Matrix

I am looking to use the CopulaDistribution fucntion, with a "MultiNormal" kernal. However, for the input, O require a covariance matrix. However, I only have a correlation matrix. Is there a way to ...
1
vote
2answers
56 views

Table operation after export and import of data does not give me the same result

If I create a table of this kind: (m1 = Table[{RandomInteger[], RandomInteger[{1, 5}, {3}]}, {i, 1, 5}]) // MatrixForm which looks like I know how to pick ...
1
vote
0answers
101 views

Best way to create symmetric matrices with block structure and additional symmetries of the submatrices

Update: you can now skip the "My attempted solution" part and jump to "My first attempt for improvement" in the end of the question. My question is related to Best way to create symmetric matrices . ...
0
votes
1answer
60 views

How to use Hold on a variable defined as a graph

I'm working on doing operations on different graphs and getting their probability node degree distributions using a simple algorithm. If I have many defined graphs, for example: ...
2
votes
2answers
44 views

Findings rows in RREF matrix which contain nothing but a pivot

I am asked to find all rows in a matrix in reduced row echelon form which contain nothing but pivots (pivot is $1$, all other entries are $0$). For example, in this matrix: $$ \begin{bmatrix} 1 ...
1
vote
0answers
43 views

Dealing with answers that have Root[ …] when finding an Eigensystem

This is a 3x3 matrix and I think it should solve for the expressions in terms of radicals. I am not sure what to do with this.
0
votes
1answer
93 views

Block matrix and calculate it's inverse

How to define the following block matrix $$ A=\begin{bmatrix} H-G_1 & -G_1 & \ldots & -G_1 \\ -G_2 & H-G_2 & \ldots & -G_2 \\ \vdots & \ldots & \vdots & \vdots ...
3
votes
0answers
80 views

Understanding polyharmonic splines

Raul Narain and J.M. gives implementation of the thin plate polyharmonic splines in this post. Raul Narian's method is clear. J.M.'s is convenient to reuse. But J.M. used too many ...
-2
votes
1answer
54 views

Create a matrix by crossing a list

I've a list L of elements. I want to create a matrix by laying each elements of L in both rows and columns where each ...
0
votes
1answer
54 views

Problem in LinearProgramming [closed]

I wrote a integer Linear programming where matrix c, m and b are: ...
1
vote
3answers
113 views

Matrices and Combination

When the positive integers 1 to 9, inclusive, are used exactly once as elements of a 3 x 3 matrix, what is the largest possible value of the determinant of the matrix?
1
vote
0answers
66 views

Lens profile in a grid

So I have a FDTD code which works and its all good the propagator of the code it self is: ...
0
votes
1answer
33 views

dropOperator done on Matrix of a Matrix - How is this done?

I have implemented this dropOperator from dropOperator from stackexchange and works fine on a single Matrix. But now I have a Matrix of a Matrix and want to drop some rows or columns (in the pic below ...
1
vote
1answer
93 views

How to print non zero elements of the matrix containing zero elements and non-zero elements both?

A matrix with both non-zero and zero elements is given. I want to print only the non-zero elements of the matrix. What is syntax that have to be used for this? matr2 = Table[FortranForm[matrixx[[i, ...
0
votes
0answers
96 views

Solving for a Transfer Matrix

I am currently working on a program that will solve a transfer matrix and extract several elements. Particularly, the transfer matrix is characterized by four elements in a ...
2
votes
2answers
82 views

Find the indexes of dependent columns

I have a fairly large singular square matrix, of size 37 and rank 35. Is there a way to get a vector with the (groups of) indexes of the columns in the original matrix that are linearly dependent? ...
0
votes
1answer
51 views

Entering block matrices, general case doesn't work

I want to enter several matrices at different positions in blocks. There is already a very similar answer here: http://mathematica.stackexchange.com/a/3562/6138 I thought that simply generalizing ...
1
vote
2answers
77 views

How to extract matrix which produces given symbolic linear combinations?

Suppose I have a column matrix $\alpha$, consisting of some symbols ...
1
vote
1answer
77 views

What does it mean: “Assuming a matrix | Use a list of lists instead”?

I have entered a matrix by Insert->Table/Matrix->New. After adding it to code, Mathematica wrote a remark: "Assuming a matrix | Use a list of lists instead". ...
1
vote
2answers
46 views

How to add a part of a list to a function?

I want to be able to add a specific portion of a list to a part of a function but this fucntion intakes 6 variables where as the list is of example: ...
0
votes
1answer
53 views

LinearSolve in Mathematica, used to find square matrix

Another issue I have with Mathematica today is that I want to solve the following matrix equation: X.b=c where b and c are two vectors, and X is a square ...
1
vote
1answer
45 views

How to indroduce a value for the functions inside a matrix? [closed]

I would like to assign certain values to the X and Y variables which are inside the functions in the matrix. Thus, I would like to get a matrix with values based on the transformation in Psi matrix. ...
2
votes
1answer
176 views

Log of a Matrix

I have used the command MatrixLog[m] But it gives natural log of the matrix. How can I find the Log (to the base 2) of a matrix?
21
votes
2answers
3k views

How to form a block-diagonal Matrix from a list of matrices?

For example, like this: I know join[...] works, but it is a bit troublesome for multiple matrices. I also tried DiagonalMatrix[...], but DiagonalMatrix can only form a matrix from a list of ...
2
votes
1answer
51 views

Sort a vector of vectors of vectors

Let's hope I'm calling it well, I have this vector, or matrix, now I really don't know what it is ...
1
vote
0answers
49 views

Displaying a matrix as an array of solid rectangular blocks [duplicate]

I would like to plot an array of numbers as a surface, with each number the height of a square, and with the squares connected to adjacent squares with vertical rectangles, up or down as appropriate. ...
3
votes
2answers
358 views

A lot of matrix multiplication

So I have a set of 15 $4\times 4$ matrices which I call $X_i, (i=1,2..15)$ and a set of 6 $4\times 4$ matrices which I call $y_j, (j=1,2...6)$. Now I have to calculate $(X_i y_j)-(y_j X_i^*)$ for ...
8
votes
3answers
300 views

How to remove a line of a matrix if not all elements are numeric?

I have a matrix a n columns and m lines. I'd like to efficiently remove the lines that are not entirely composed of numeric ...
2
votes
1answer
256 views

Matrix exponential MatrixExp[] vs Sum[MatrixPower[]] doesn't match?

I might be an idiot, but I cannot get the manual expansion of $e^{At}$ to match the MatrixExp[A t] result. For example, I have the following: ...
2
votes
1answer
112 views

matrix multiplication speed

Consider the codes below: ...
1
vote
1answer
52 views

Easy way to perform multiplication of two 2x2 matrices, that contain list elements?

I have two 2x2 matrices, which elements are lists (so overall structure can be complicated). I need to perform matrix multiplication of these 2x2 matrices as if the elements didn't have its inner ...
0
votes
0answers
113 views

Matrix multiplication

I want to multiply 1000by1000 matrices but MMA runs out of RAM. ...
0
votes
2answers
44 views
1
vote
1answer
52 views

Insert a linebreak and character repeatedly into a matrix output which is in fortranForm

Suppose I have a very long string which is a11 element of matrix a11=2*gopsv-2*Bgopsvw+2*acgmops*v+2*cgmopsv*B-2*acgmopsvB+3*gmopsvB-3*BgmopsvwB+m*w2*B +5*acgm2 +opsvB -ac*m2*w2*B +cgm2*opsvB* - ...
1
vote
0answers
27 views

How to show Output of matrix in FortranForm with “&” character?

I have a matrix. and i have shown the output of matrix one by one element in FortranForm. the problem is i want to put "&" continuation charater in output because when i am copying the data into ...
0
votes
0answers
30 views

hOW TO PUT '&' OPERATOR in output of matrix elements that are in FortranForm?

i have matrix and i have shown the output in fortranForm. but due to large characters in elements of matrix, when i copied the data into fortran Code, it does not take copied data because of line ...
0
votes
2answers
73 views

How to show output of a matrix in m(1,1)=a11 m(1,2)=a12 …in this way…i have 50 *50 size matrix

How to show output of a matrix in m(1,1)=a11 m(1,2)=a12 ...in this way......i have 50 *50 size matrix so i want to do it efficiently. output to be shown like m(1,1)=a11 (in fortranForm) m(1,2)=a12 ...
0
votes
2answers
55 views

Output of matrix in FortranForm

matr2 = Table[FortranForm[matr[[i, j]]], {i, 4}, {j, 6}] but i want output to be more like this matrix(1,1)=a11 output in ...
8
votes
2answers
1k views

How to use “Drop” function to drop matrix' rows and columns in an arbitrary way?

The built-in function "Drop" can delete a Matrix's row and column. Typical syntax for "Drop" is as follows: Drop[list,seq1,seq2...] But what if I want to drop a ...
0
votes
1answer
64 views

How large can be the dimension of a complex matrix which Mathematica can handle to find its eigenalues?

I have been working with 12 cross 12 complex matrix in Mathematica , I need to work with bigger size matrix of the dimension of the order of hundreds , I was wondering if Mathematica can handle ...
0
votes
0answers
95 views

using elements from a matrix into a function

Hi this is what i have done so far i have a surface with the length "l" and width "w". and i have split this surface into m*n sub surfaces. as shown below. ...
0
votes
1answer
111 views

Integrating elements from matrix

oI'm kinda new at using Mathematica. What I'm trying to do is create a matrix with elements inside. ...
12
votes
5answers
3k views

Division by zero is slow

Suppose I have two arrays of data, which I want to divide: ...
4
votes
0answers
67 views

Eigensystem on HPC

I am submitting Mathematica jobs to an HPC. I have a large matrix that is a function of (x,y) and I am diagonalizing it for around 500 points in the plane. My initial idea was to request a node with ...
13
votes
4answers
552 views

Can (compiled) matrix permanent evaluation be further sped-up?

Update II  Sample code for simulating boson-sampling experiments has been added (as an answer). This code exploits new Mathematica capabilities relating to both empirical and smooth ...