Questions on the manipulation of matrices in Mathematica.

learn more… | top users | synonyms (1)

1
vote
0answers
29 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
76 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
76 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
51 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
50 views

Problem in LinearProgramming [on hold]

I wrote a integer Linear programming where matrix c, m and b are: ...
1
vote
3answers
103 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
55 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
32 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
88 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
56 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
70 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
42 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 ...
0
votes
0answers
26 views

Can anyone help me deduce a matrix inequality? [closed]

The following lemma is taken from references firstly. Lemma 1 [1-2] Given matrices $Q=Q^{T} , F, M$ and $N$ of appropriate dimensions, then $$Q+MFN+N^{T}F^{T}M^{T}<0$$ for all $F$ satisfying ...
1
vote
2answers
67 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
72 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
45 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
0answers
24 views

Calculate number of probabilities [migrated]

I want to calculate a number of probabilities of a+b+c=1 For a vary from 0 to 1 with an incrementing of 0.1 For ...
0
votes
1answer
47 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
38 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
167 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
46 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
48 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
357 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
299 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
214 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
99 views

matrix multiplication speed

Consider the codes below: ...
1
vote
1answer
38 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
109 views

Matrix multiplication

I want to multiply 1000by1000 matrices but MMA runs out of RAM. ...
0
votes
2answers
39 views
1
vote
1answer
48 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
25 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
28 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
66 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
50 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 ...
0
votes
1answer
48 views

Restricting Numbers in a Matrix

I am generating a random N x N matrix, but with a certain restriction. What I'm trying to do is that when there's a "1" in a position, all neighboring positions must turn to "0" (so if [i,j] = 1, then ...
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
59 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
93 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
89 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. ...
1
vote
1answer
210 views

Mean squared error of two matrices

I want to compare two matrices. For this I use the mean squared error between them with the following code mse[mat1_, mat2_] :=(mat1 - mat2)^2 // Flatten // Mean ...
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
65 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
536 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 ...
1
vote
1answer
73 views

How to form a variable from matrix elements

I have matrix with n rows and 2 columns, say m = {{x11, y12}, {x21, y22}, ..., {xn1, yn2}. Now, I want to form three new variables for example: ...
5
votes
1answer
459 views

Over 30mins to generate the first eigenvector?

Is it normal for Mathematica to take over 30mins to try to compute the first eigenvector of a 100x100 matrix? The matrix is reasonably sparse - about 90% of the cells are 0s and each column sums to ...
0
votes
1answer
59 views

Submatrix with linearly independent columns

What I want is the submatrix where all the linearly dependent rows have been eliminated. I tried implementing this solution, but it doesn't work in the following example: ...