# Questions tagged [matrix]

Questions on the manipulation of matrices in Mathematica.

2,271 questions
Filter by
Sorted by
Tagged with
56 views

### How to generate vectors with programming

I want to generate all possible vectors programicaly with entrys in $\Bbb Z_4$: $$A_j:=\begin{bmatrix}x_1\\ x_2\end{bmatrix}, \qquad x_i\in \{0,1,2,3\}, j=1,2,\cdots 16.$$
39 views

### How can I evaluate a symbolic matrix

For example if I have: Matriz = {{a, b}, {c, d}} Matriz2[a_, b_, c_, d_] := Matriz; when I run Matrix2 [1,2,3,4], the matrix is not evaluated. I would not like ...
27 views

### Problems with the parametric Recurrence Table

I am trying to construct a minimization program where I have to minimize a function with respect to a matrix. This matrix enters into the optimization program in a convoluted manner together with data....
81 views

### rule-based element selection from a matrix

For simplicity, I give a (3,3) matrix below, though my matrix is of a larger dimension. My objective is, after some matrix manipulations, to select Maximum element(s) in a row and a column, and place ...
52 views

### find a maximum parameter for a range of target eigenvalues as a function of matrix dimension

I have a symbolic tridiagonal matrix of this form ...
895 views

35 views

### How to plot multiple functions in a graph with different colors?

I have a general {i,x,y} dimensional matrix, and I want to plot all "i" {x,y} matrices in one graph. How can I do it in a way that I can still distinguish each "i"th curve from the other (I mean ...
1k views

### Difficulty using LUDecomposition

I'm having trouble using LUDecomposition with pivoting. I read the Mathematica help on this particular command, but I'm still lost. Take a matrix like: ...
55 views

### How to carry a matrix in algebric form under “set delayed”

I have a small query and a related problem regarding the working methodology of Mathematica under set delayed/Do functions. Here is a simplified version of my problem. ...
76 views

### Find position equal columns of matrix

Consider the following rectangular matrix M = {{1,1,1,1},{2,2,4,4},{3,3,5,5},{9,9,3,1}} I would like to extract the position of equal columns. Is there a simple ...
34 views

### How to work with a $k$x$k$ matrix with $k$ undefined?

I have the following $k$x$k$ square matrix m: ...
83 views

### Compute the potential of confusion between two matrices

I have a problem. Any help will be appreciated. In order to calculate the accuracy, sensitivity, sensibility and F1 score between diseases and their symptoms, I have two matrices with a different ...
21 views

### Eigenvalues and inverse of matrix which has matrix entries

Suppose I have a $2\times2$ matrix which contains $2\times2$ matrices as entries, is there a clean way to find the inverse of such object and compute its eigenvalues/vectors? My code is ...
30 views

### Simulating Stochastic Matrix Differential Equation with Arbitrary Autocorrelation Function

I want to numerically simulate a matrix differential equation that includes a stochastic (vector) Gaussian noise $\mathbf{n}$, where the different vector components are independent, and each component ...
212 views

### Manipulate a list: replace random position of a specific integer n times by 0

I have this matrix with 3 sublists: d = {{1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0}, {0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1}, {0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0}}; For ...
34 views

### Matrix Vector multiplication [duplicate]

I have a rather simple question which surprisingly i could find the answer theres a matrix $U$ whith is $4*4$ and a vector $A$ which is $4*1$ and when I wand to multiply them by $U.A$ operator i get ...
393 views

### Create Array from list of indices/values

Is there is a performat way to convert something like {{0,0},a},{{0,1},c},{{1,0},d},{{1,1},e} into {{a,b},{c,d}} The ...
36 views

### How to save a all matrices renewed in each iteration?

I have a (n by m) matrix , in which the elements are recalculated and replaced by new ones in each iteration. (In other words I have a loop in which the elements of the mentioned matrix are being ...
162 views

### Multiply vectors in a matrix by a matrix

I have a matrix of vectors e.g. mat1 = Table[Table[RandomReal[1], 2], n, n]; which is actually a matrix of cartesian coordiantes ...
53 views

### MatrixConditionNumber does not work in version 12.0

A = {{1., 0.}, {0., 2.}}; LinearAlgebra`MatrixConditionNumber[A]
371 views

### Efficiently defining a SparseArray function

I've got a fairly large SparseMatrix (~60,000 entries in a ~10,000-by-10,000 matrix) that depends on two parameters (im1 and <...
571 views

### How to convert diagonal matrix to rectangular matrix

Suppose you have the following diagonal matrix: $\left( \begin{array}{cc} a & 0 \\ 0 & \{b,c\} \end{array} \right)$ How can the above matrix be converted to the following rectangular one?...
1k views

### How can I define a very large matrix efficiently?

Here's a 7x7 matrix: ...
33 views

### Identification of linear combinations in a matrix

I have a matrix R which is having a dimension of 20 cross 20. When I extracted the rank of this matrix I got 16. I just wanted to which are these four rows are or columns which are dependent on each ...
54 views

### Matrix transformation

Let an expression $X^T AX+B^TX$, how can I transform it as $Y^T C Y$; where $Y=[X, 1]$, find $C$ in terms of $A$ and $B$ using Mathematica?
116 views

### How to import latex matrices into Mathematica?

I have a lot of $\LaTeX$ matrices, and I want to find their eigenvalues and eigenvectors. I tried to import them to Mathematica with: ...
57 views

### Inverse matrix not computing [closed]

Hi just wondering why my Inverse of matrix will not compute? I don't believe its wrapped from //MatrixForm because I copied it by hand into a new document and it still would not work. Any ides? ...
38 views

### Why doesn't this evaluate further [duplicate]

The figure above shows the code as typed into Mathematica. In the fourth last line (or In[15] as you prefer) the expression is not evaluated to the fullest extent possible. Why does this occur? I ...