Questions tagged [matrix]

Questions on the manipulation of matrices in Mathematica.

Filter by
Sorted by
Tagged with
0
votes
2answers
28 views

Create symmetric array of function values

I have function B[i,j] where i,j are integers. Then I create array: b = Array[B, {3,3}] now I set values of ...
3
votes
3answers
137 views

easiest way to construct the following determinant

What is the easiest way to construct the following determinant?] p is variable, I want to vary value of p each time and get the appropriate determinant.
0
votes
0answers
26 views

How to select multi vectors with particular condition

I have a matrix as: a01={{225., 1, 2, 3, 4}, {225.5, 2, 3, 4, 5}, {226., 3, 4, 5, 6}, {226.5, 4,5,6,7}} And I want to choose head: ...
5
votes
3answers
417 views

Defining a big matrix for iterative algorithm

I need to solve this system of equations with Seidel and Jacobi methods, so I tried to define a big matrix in Wolfram. I have read documentation, and I wrote the following command that should help me,...
3
votes
1answer
225 views

Solve the vector-matrix equation. Minimize the length of the desired n-dimensional vector

There is the following vector-matrix equation: $$\mathbf x^\top\mathbf M\mathbf x=\begin{bmatrix}x_1&x_2&x_3\end{bmatrix}\begin{bmatrix}a&b&c\\d&e&f\\g&h&i\end{bmatrix}...
1
vote
1answer
58 views

How to save matrices from each iteration of i? [closed]

I am trying to get the transformation matrices from DH parameter table and would like to save each matrix (Ai) getting after each iteration of i. How can I do that? ...
4
votes
4answers
111 views

How to transform an UpperDiagonalMatrix into a symmetric matrix in Mathematica 5.2?

I have an UpperDiagonalMatrix as the following, how to transform it into a symmetric matrix in Mathematica 5.2? Note: don't use the command ...
0
votes
1answer
54 views

Homogeneous Transformation matrix from DH table

I am very new to mathematics and I'm trying to write a code for getting the link frame transformation equations (0T1, 1T2...) using for loop. I am having some success with a poorly written code ...
6
votes
2answers
166 views

Element-wise multiplication of an array and a matrix

How can I express multiplication of an array and a matrix so that {x, y, z}*{{10, 20, 30}, {0, 1, 2}} gives ...
4
votes
1answer
76 views

Reduce memory cost with three matrices multiplication

My program is eating up all my RAM and the operation is related to 3 matrices multiplication, as the code shown below. example code: ...
0
votes
0answers
26 views

Filling Regions (Blocks) of a Binary Matrix with Different Probabilities

This is an extension of the following question: How to generate binary array whose elements with values 1 are randomly drawn, where the most elegant answer was posted in the comments: ...
0
votes
0answers
40 views

How to do Matrix Row Reduction but on a specific field in Mathematica?

Normally for $\mathbb{R}$ or even $\mathbb{C}$ row reducing a matrix is as simple as doing: MatrixForm[RowReduce[{a,b,c},{d,e,f},{g,h,k}]] But let's say I want ...
0
votes
1answer
130 views

How to multiply vector to create a matrix? [closed]

There might be related posts but so far I'd not been able to find them: u={u1,u2,u3} v={v1,v2,v3} where $u$ and $v$ are two column vectors. I want to use $u\...
7
votes
1answer
152 views

Efficiently calculating matrix exponential of a recursively generated matrix

Given a matrix $A$ of size $N \times N$, I want to evaluate the function \begin{equation} F(t) = |\operatorname{Tr}(\exp(-i A t))|^2 \end{equation} as a function of $t$. Here, $A[n]$ is constructed ...
0
votes
1answer
42 views

How do I implement formulas within matrices? [closed]

I'm learning Mathematica through examples given in Engineering Vibrations by Daniel J. Inman. However, there is a huge mistake given in this bit of code offered: ...
1
vote
1answer
108 views

Symbolic matrix equation with summation

Considering a set of points: Let Matrix A be: And B: Where $\bar{x}$ is given by: And the same goes for $\bar{y}$ and $\bar{z}$. I want to solve this equation: But without specifying any values. ...
0
votes
0answers
23 views

Why Dimensions of an element of a matrix in not 1? [duplicate]

I was checking the dimension of an element of a matrix all the elements are symbols. I was expecting dimensions of an element to be {1,1}. But it is not Why? ...
10
votes
2answers
236 views

Solving “Lyapunov-like” equation AX+X'B=C

Is there some way I can solve the following equation with $d-by-d$ matrices in Mathematica in reasonable time? $$AX+X'B=C$$ My solution below calls linsolve on $d^2,d^2$ matrix, which is too ...
1
vote
2answers
75 views

Determinant of matrix with asymptotic expansion

i have determinant which each element have asymptotic expansion. $\begin{bmatrix}1+5/s+6/s^3+O[1/s^4] & 1+8/s+4/s^2+O[1/s^4]\\1+2/s+2/s^3+O[1/s^4] & 1-1/s+8/s^3+O[1/s^4]\end{bmatrix}$ ...
2
votes
0answers
89 views

Block diagonalizing a complex anti-symmetric matrix

I am going to evaluate the block diagonal form of few skew-matrices. When matrix elements are real I can simply follow the approach suggested in this thread which I have implemented that as ...
1
vote
2answers
192 views

How do you implement metric tensor in Mathematica?

I'm trying to follow several tutorials on metric tensors. One of the common exercises is a polar metric. I'm stuck trying to implement this in Mathematica. According to the derivation, the polar ...
0
votes
1answer
53 views

Convert input word into vector matrix

I wold like some help of converting an input (word or number or mix) into a single row vector, such as the following: If input is ">DAVID123<" I want it to be as {>,D,A,V,I,D,1,2,3,<} where ...
2
votes
1answer
95 views

How to RowReduce a sparse matrix?

I want to compute the reduced row echelon form of a sparse matrix, but RowReduce returns a dense matrix. Is there a build-in function that computes the reduced form ...
1
vote
1answer
95 views

(Row?) reduction of a system of equations

For a mathematical problem I am trying to solve, I have (say) $(N+1)$ inhomogeneous linear equations in $M$ variables of the form $$\sum_{a=1}^{M}c_{i a}p_{a} = \xi_{i} \quad \text{ where } i=1,\...
2
votes
1answer
59 views

How to remove curly brackets in a two dimensional array near the edges?

Suppose I have a matrix {{1,2,3},{4,5,6}}. I want to remove the curly brackets near the edges, i.e., I want an output as '{1,2,3},{4,5,6}'. Somebody please help me to solve it.
8
votes
1answer
316 views

Optimization of the following code

Consider the function $$ h:[-1,1]\times I_{\sigma}\to I_{\sigma} $$ $$ (\omega, x)\mapsto \sqrt[3]{x + \sigma \omega} $$ where $ \sigma > \frac{2}{3\sqrt{3}}, I_{\sigma} = [x_-(\sigma), x_+(\sigma)]...
0
votes
1answer
68 views

Selecting solutions that evaluate to positive

How to extract symbolic outputs of Solve that evaluate to positive at given values of parameters? For example, if ...
4
votes
3answers
204 views

Eigenvectors in the limit $ \mu\rightarrow 0 $ are not the same as eigenvectors when setting $ \mu=0 $ from the beginning

I would like to find the eigenvectors of a matrix and see what the eigenvectors look like in the limit of $ \mu\rightarrow 0 $: ...
0
votes
0answers
24 views

Find the max 2nd entry of a vector in a matrix

I need to find the max of the numbers found in the 2nd entry of the lists of (7 lists of 3 lists of 5 numbers ) So example would be a 3 by 5 matrix where element in the matrix has a list . And I ...
1
vote
1answer
33 views

How to find a max of a certain matrix

find the Max of the numbers found in the 2nd entry of these lists. Also give its Position: Ex : {1 2 3 4 5} {1 3 4 5 6} {2 5 5 5 5} This is a 1,3 Matrix , and we want to get the highest number of ...
0
votes
1answer
25 views

How to save executing time of select list from multi conditions

I have a matrix: `MT={{1, 54, 55}, {2, 841, 5}, {3, 6, 65}, {4, 28, 328}, {5, 188, 21}, {6, 2, 887}, {7, 36, 32}, {8, 7, 2}}` And i need select the list which ...
5
votes
2answers
712 views

How to generate all $ 3 \times 3 $ matrices with $ a,a,a,a,b,b,b,c,c $?

How to generate all $ 3 \times 3 $ matrices with $ a,a,a,a,b,b,b,c,c $, which can not be obtained from each other by rotation transformation?
2
votes
2answers
148 views

How to remove global phase from matrices

I have a list of 3 by 3 complex matrices. I would like to remove the matrices that are similar up to a global phase factor. For instance, I have $ M, \mathrm e^{\mathrm i2\pi/3}M $ and $ \mathrm e^{-\...
1
vote
0answers
36 views

Getting a non zero determinant of matrix R, when the Rank of R is not equal to Dimension of R

I have a square matrix whose dimensions is 9 cross 9, when I extract the rank of the matrix R, I am getting rank as 6. I have constructed R matrix by minimizing the Lagrangian Lg with respect to a[1].....
2
votes
1answer
119 views

Numerically solve system of 64 equations with 64 variables in matrix form

I have 2 matrix $A$ and $B$ both of size 16x16. Most of the values $A_{i,j}$ and $B_{i,j}$ for the same couple $(i,j)$ are equal to 0. The remaining ones are a positive floating number for $A$ and a ...
1
vote
0answers
31 views

How to minimize the eigenvalues of a hermitian matrix?

Suppose I have a complex hermitian matrix, M[x_,y_] whose eigenvalues must be real.I tried to minimize the first eigenvalue by writing following command:f[x_,y_]:=Eigenvalues[M[x,y]][[1]]; Minimize[f[...
1
vote
0answers
29 views

MatrixForm a product of matrices [closed]

I was hoping that MatrixForm[SingularValueDecomposition[{{1, 2}, {3, 4}}] ] would neatly display the singular value decomposition of a matrix in the form of a ...
0
votes
2answers
101 views

Matrix equation solving

I am new to Mathematica and I try to apply the solution given to this problem. So I have: $$A = \begin{pmatrix}50 & 3 & 10 & 2\\\ 3 & 60 & 7 & 1\\\ 10 & 7 & 55 & 4\...
1
vote
0answers
77 views

How can I evaluate a symbolic matrix [closed]

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 ...
2
votes
2answers
84 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.$$
1
vote
0answers
41 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....
3
votes
2answers
104 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 ...
4
votes
1answer
81 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 ...
4
votes
2answers
956 views

Two matrices that are not similar have (almost) same eigenvalues [closed]

I have two matrices $$ A=\begin{pmatrix} a & 0 & 0 \\ 0 & b & 0 \\ 0 & 0 & c \end{pmatrix} \quad \text{ and } \quad B=\begin{pmatrix} d & e & f \\ d & e &...
0
votes
1answer
37 views

diagonalisation of systems of symbolic equations from two cross products

A description of what I'm attempting: Given a generic vector $\vec{r}$ and a point in space $D$, I want to build a reference frame centred in $\vec{r}= (x,y,z)$, with one axis directed along the ...
8
votes
1answer
201 views

Getting scores from PCA

I'm not super familiar with Principal Component Analysis, but from what I understand, it sorts a vector in order of decreasing variance, and uses that to transform the vector to correlate variables ...
0
votes
0answers
43 views

Improve speed of NIntegrate for functions which are sums of complex exponentials

I need to improve the efficiency for numerically evaluating a matrix element, which uses NIntegrate of the several functions (which are all sums of complex exponentials). Creating the functions from ...
0
votes
0answers
58 views

What row do I change to make my determinant non zero?

I wish to make a matrix that has an inverse. I need rows that look like oscillating functions so I decided to base my matrix on ChebyshevT. This code makes an n by ...
7
votes
4answers
93 views

Take $ n^\text{th} $ sub-list with equal distances

I have been looking at Span, Take, etc. functions but I couldn't figure out how can I extract elements likes this ...
8
votes
1answer
267 views

Finding the null space of a large sparse matrix

I am trying to compute the null space of a large $n\times n$ sparse matrix. No matter how large the dimension of the matrix is, it will always look like as below: The figure on the left shows the ...

1
5 6
7
8 9
53