Questions on the manipulation of matrices in Mathematica.

learn more… | top users | synonyms (1)

0
votes
0answers
43 views

I see error messages when I use LogLinear Plot but not when I use Plot

I have written an application with Manipulate that plots the results of several calculations. What I find strange is that when I have my application use ...
2
votes
1answer
45 views

How to input and output partitioned matrices that show partitions and compute as normal?

I want to demonstrate multiplication of partitioned matrices as in the example here. Using the Insert Menu, you can build a matrix and draw lines between rows and columns. However, I want to be able ...
1
vote
3answers
38 views

Collect the lists

I have a list of lists from which I pick out the positions of the number 1 and then print out these positions for each list. I am having some trouble collecting what I am printing into a list / matrix ...
2
votes
1answer
67 views

Why won't Mathematica obtain eigenvectors for this symmetric matrix?

The matrix is a real symmetric 4x4: ...
1
vote
0answers
65 views

How to stack matrices: one on top of another? [on hold]

I have over 10 thousands matrices each with n by 3 size. For example, M[1]={{1,2,3},{4,5,6},{7,8,9}}, M[5]={{10,11,12},{13,14,15}} and M[20]={{16,17,18},{19,20,21},{22,23,24},{25,26,27}}. I want to ...
2
votes
2answers
124 views

Binarizing a matrix

I have an image with a few bright pixels with the remaining ones very dark. The difference is in orders of magnitude. I want to binarize this matrix (corresponding to the image) making all values ...
2
votes
3answers
85 views

Speeding Up Replacing of Labels in Large Matrix?

I am Mathematica novice and am trying to find a fast way to replace labels in some rather large matrices (512x512 or 1024x1024) that have resulted from segmenting images with WatershedComponents or ...
0
votes
0answers
25 views

Calculating Muliti-integral Time-Ordering operator [migrated]

I am trying to solve the time-ordering operator Like this: $S(t)=\mathcal{T}e^{\int_0^tduA(u)\int_0^udvB(v)}S(0)$. How can I calculate S(t) with minimum error?
0
votes
0answers
52 views

deleteduplicates Delete elements of a list [duplicate]

I have a math problem about Mathematica, I am looking help from you. I hope that you could help me. The Math Problem: list= { {0,0,1},{1,0,0},{0,1,0} ,{1,2,3}}; ...
1
vote
4answers
85 views

How to plot a graph from it's incidence matrix?

I'm using Mathematica v9 and am trying to draw a graph by using it's incidence graph, but it won't draw it, which occurs an error "is not a valid incidence matrix.". But I've checked my matrix, and ...
3
votes
2answers
205 views

All possible pairs of two items

I have 4 different items {1, 2, 3, 4}. I want to obtain all possible pairs of two of the items. I have written: ...
1
vote
2answers
69 views

Is there an easy way to divide a matrix into four blocks?

I often get a data table with column names and row names. For example: ...
3
votes
4answers
104 views
1
vote
1answer
57 views

Inverting matrix of unknown size

I have a matrix that has a variable number of columns and rows (but it is always square). The matrix is: $$ \Gamma = \begin{bmatrix} \Theta & 0 & 0 & 0 & T & 0 & R_j \\ ...
8
votes
8answers
661 views

Replace interior of matrix with zeros

I have f.e. the following square matrix: ...
6
votes
2answers
165 views
+50

How to estimate the matrix condition number in the 2-Norm?

The Mathematica documentation say it is possible to estimate the Matrix condition number in norm 1, 2, Infinity. But the 2-Norm raise a message. This is an extract from reference documentation ...
0
votes
1answer
80 views

LinearSolve failing to find solution to system of linear equations of 64 variables

I've got a 64x64 Matrix L for which I want to find the solution to the matrix equation L . x == rho. L is defined as ...
0
votes
1answer
68 views

eigenvector bug also for matrix with numeric value [closed]

I just realize that probably there is a bug also in calculating the eigenvector of a matrix with numeric values (see here for bug in eigenvector calculation with symbolic value). In particular in my ...
2
votes
1answer
84 views

Matrix constructed as a function inside a for-loop [closed]

I am trying to construct a matrix A which depends on variables x and y through iteration. My ...
0
votes
2answers
49 views

Modifying elements of a matrix after construction [closed]

Suppose I have constructed a matrix with all elements as a constant (say 1): N=4; A=ConstantArray[1, {N, N}]; Now I want to make A(2,3)=23 and A(4,3)=43. Can I ...
0
votes
1answer
44 views

How to track row swap in Gaussian elimination?

How do I track which rows were swapped in the Gaussian elimination using RowReduce? I am doing metabolic control analysis on a mathematical of the energy metabolism I have in Mathematica. I need to ...
0
votes
0answers
23 views

SVD (Singular value decomposition) for matrix with constant row sum and column sum [migrated]

M is a m*n matrix, the row sum equals to (K/m) and the column sum equals to (K/n). After SVD, we can find three matrix U,S,V, M=USV where U,V are orthogonal matrix and S is diagonal matrix. I can ...
0
votes
0answers
46 views

Geometric Transformation not working - degenerate points?

I've successfully used FindGeometricTransformation to project the simplex triangle onto the x-y plane: ...
1
vote
2answers
123 views

Generic Matrices

A multivariate Gaussian distribution for $k$ dimensions looks like this: $$\frac{1}{\sqrt{(2\pi)^k|\mathbf \Sigma|}}\mathbf e^{ -\frac 1 2 \mathbf x^T \mathbf \Sigma^{-1}\mathbf x }$$ $\mathbf x$ ...
1
vote
1answer
77 views

Checkbox Matrix

Is it possible to create a dynamically changing binary $n \times n$ matrix $A$, which appears to the user as a $n \times n$ matrix/table of checkboxes and the user can change the entries of $A$ by ...
0
votes
2answers
62 views

solving series of matrices by simply multiplication

I have a number of matrices {2*2} containing element in series ....so by what method I solve that ... ...
6
votes
2answers
185 views

How to get rid of nested matrices

If I type into Mathematica TensorProduct[IdentityMatrix[2],IdentityMatrix[2]] It gives me a result that has nested matrices. How do I turn that into a normal ...
2
votes
3answers
171 views

How can I reproduce the MatrixForm, NumberForm, XyzForm behavior?

I wish to write a function like MatrixForm, that affect only display but not evaluation, i.e. a function that automatically is stripped away from output. More ...
1
vote
1answer
47 views

references in a nested matrix

I have a nested matrix n: ...
15
votes
11answers
1k views

Efficient way to build a certain quadratic matrix

For odd n I'm looking for a short and swift way to construct with (f.e.) n = 3 n = 11 ...
-4
votes
2answers
92 views

Output of mathematica. Quaternion to Matrix

If I have the following instructions: How will it be the output/how will it appears in Mathematica? something like this: I can't recognize the output in mathematica... How can I do to appear ...
4
votes
0answers
62 views

Bug in PositiveDefiniteMatrixQ?

This seems like a bug in PositiveDefiniteMatrixQ to me: ...
1
vote
0answers
70 views

How to sequentially select, from a large set of tuples (of matrices), those with a certain property

I'm interested in finding a computationally efficient way for selecting all tuples of matrices which have a certain property. The property I'm interested in is that I want the column sum, of f[the ...
5
votes
2answers
99 views

Comparison Operation for Nested Matrices

I have a nested matrix n as bellow ...
0
votes
1answer
115 views

Rotation matrix $\to$ quaternion

I found a very good link about quaternions in Mathematica , but I don't know how to create a quaternion from a rotation matrix. Can anyone help me, please? Update I need this: A rotation may be ...
4
votes
6answers
382 views

Insert all elements from one matrix into another

I have two matrices $A$ and $B$ which are the same size. Each element of $A$ is a list of numbers. Each element of $B$ is just a number. How do I insert each element of $B$ into the corresponding list ...
0
votes
1answer
69 views

How to power-series expand determinants?

Say $g$ is a matrix which is given as, $g = g_0 + xg_2 + x^2 g_4 .. +x^{d/2 -1}g_{d-2}+ x^{d/2}(g_d + h_d(log (x)))$ where $d$ is an even number and each $g_i$ is a matrix (same dimension as $g$) and ...
0
votes
1answer
57 views

Matrix operations performed with column-vectors

We have 3 matrices: m1, m2 and b. We want to apply matrix operations (dot or sum) in a ...
1
vote
2answers
55 views

Importing Text file and removing columns [closed]

I have a file that has 7 column but i only want to import two column from it, that is 1st and 3rd column from the file. How can i do that and this is the list for example: ...
3
votes
2answers
177 views

Addition of Matrices [closed]

How can I add the Matrices created by this: SeedRandom@0; Table[RandomInteger[{0, 34}, {2, 2}], {2}, {5}] // MatrixForm $\left( \begin{array}{ccccc} \left( ...
2
votes
2answers
140 views

Measures of association, Concordant and Discordant

I want to calculate concordant and discordant pairs on nx2 tables. ...
3
votes
3answers
110 views

Creating nested matrix using random integers

How do i create 15x2 matrix with 2x2 random integer elements? My code only returned identical 2x2 elements:
28
votes
8answers
1k views

Longest path in 0/1 matrix

I have a matrix of 0's and 1's forming a number of disjoint paths:   I would like to find the lengths of the paths, and from that "spectrum," the longest length (in the above example: 27, ...
0
votes
1answer
108 views

Inverse of a restriction of a non-invertible matrix

Let $A∈R^{4×4}$ be a non-invertible matrix, with $2$-dimensional kernel. How can I compute the inverse of the restriction of $A$ on a subspace where it is invertible: $A^{-1}v \,\,\,\,$ where ...
0
votes
0answers
32 views

how to rewire the minimum number of edges in a disconnected bipartite graph, so to transform it in a connected one

Consider an incidence matrix A for a bipartite graph (Aij=1 if node i of group 1 and node j of group 2 are connected). A is not symmetric. Assume that A is disconnected or only weakly connected, i.e. ...
1
vote
1answer
81 views

Principal Components - how to obtain linear transformations?

I have a list "xlsf" with 6 columns and 1200 rows for PCA analysis. The PrincipalComponents[xlsf] gives the following: "The principal components of matrix are linear transformations of the original ...
0
votes
1answer
51 views

Extract a smaller matrix from a bigger one [closed]

May be duplicate, but, how it is possible to make a matrix or table of smaller dimensions, from a matrix with bigger dimensions. I mean, one may want to extract a 25*25 table from a 25*50 matrix. I ...
0
votes
0answers
113 views

3D isosurface plotting

I have a matrix of data of the form of 3 vectors R, Z, M1, M2, M3 ..., cylindric coordinates representing a measurement M of an axisymmetric hypersonic flow at the position R, Z (I don't measure along ...
1
vote
2answers
105 views

Selecting parts of a matrix via indices given by a vector

I have a column vector of the form $\{1, 1, 2, 3, 2, 3\}^t$ and an associated matrix that has the same number of rows as the column vector, $6$, and a number of columns that is equal to the maximum of ...