I am looking for a way to generate random tridiagonal symmetric positive definite matrices in Matlab. I need to be able to generate a matrix of specific size (any number between 1-101). Does anybody know how to do that?
2026-02-22 22:26:16.1771799176
Bumbble Comm
On
Generating a random tridiagonal symmetric positive definite matrix
1.1k Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
2
There are 2 best solutions below
3
Bumbble Comm
On
Rough implementation based on Rócherz's anwser
function [A] = triPosDef(n)
%The function generates a random tridiagonal symmetric
%positive definite n by n matrix;
b = randn(1,n-1);
a = [abs(b), 0] +[0, abs(b)] +abs(randn(1,n));
A=diag(b,-1)+diag(b,1)+diag(a);
end
Related Questions in MATLAB
- Taking snapshots of an animation in PDE toolbox in Matlab
- Including a time delay term for a differential equation
- Dealing with a large Kronecker product in Matlab
- Apply affine heat equation on images
- How to construct a B-spline from nodal point in Matlab?
- How to solve an algebraic Riccati equation when the Hamiltonian spectrum is too close to the imaginary axis.
- Error calculating diffusion equation solution by fft
- How to simulate a random unitary matrix with the condition that each entry is a complex number with the absolute value 1 in matlab
- Implementation help for Extended Euclidean Algorithm
- Optimization problem in Matlab
Related Questions in POSITIVE-DEFINITE
- Show that this matrix is positive definite
- A minimal eigenvalue inequality for Positive Definite Matrix
- Show that this function is concave?
- $A^2$ is a positive definite matrix.
- Condition for symmetric part of $A$ for $\|x(t)\|$ monotonically decreasing ($\dot{x} = Ax(t)$)
- The determinant of the sum of a positive definite matrix with a symmetric singular matrix
- Using complete the square to determine positive definite matrices
- How the principal submatrix of a PSD matrix could be positive definite?
- Aribtrary large ratio for eigenvalues of positive definite matrices
- Positive-definiteness of the Schur Complement
Related Questions in RANDOM-MATRICES
- Distribution of min/max row sum of matrix with i.i.d. uniform random variables
- The Cauchy transform of Marchenko-Pastur law
- Is scaling (related to matrix size $n$) and eigenvalue calculation exchangeable when discussing eigenvalue distribution of random matrix
- What is an Operator Matrix for the operation which happens in the reverse direction?
- Variance of $\mathrm{Proj}_{\mathcal{R}(A^T)}(z)$ for $z \sim \mathcal{N}(0, I_m)$.
- How to simulate a random unitary matrix with the condition that each entry is a complex number with the absolute value 1 in matlab
- Explaining a model that obtain matrice A and B from M by solving optimization problem
- How to bound the L-2 norm of the product of two non-square matrices
- Expected number of operations until matrix contains no zeros.
- How should I proceed to solve the below mentioned non-convex optimisation problem?
Related Questions in SYMMETRIC-MATRICES
- $A^2$ is a positive definite matrix.
- Showing that the Jacobi method doesn't converge with $A=\begin{bmatrix}2 & \pm2\sqrt2 & 0 \\ \pm2\sqrt2&8&\pm2\sqrt2 \\ 0&\pm2\sqrt2&2 \end{bmatrix}$
- Is $A-B$ never normal?
- Is a complex symmetric square matrix with zero diagonal diagonalizable?
- Symmetry of the tetrahedron as a subgroup of the cube
- Rotating a matrix to become symmetric
- Diagonalize real symmetric matrix
- How to solve for $L$ in $X = LL^T$?
- Showing a block matrix is SPD
- Proving symmetric matrix has positive eigenvalues
Related Questions in TRIDIAGONAL-MATRICES
- Prove that $Q^{T}TQ$ is symmetric and tridiagonal, where $Q,R$ is $QR$ decomposition of symmetric tridiagonal matrix $T$
- Spectrum of tridiagonal block matrix
- The eigenvector of toeplitz matrix
- Generating a random tridiagonal symmetric positive definite matrix
- Inversion of a Tridiagonal Matrices and Recurrence equation
- Using Cholesky decomposition to solve a system of equaions $A^TAx=b$
- What is the rank of $B$?
- Is there a fast way to prove a symmetric tridiagonal matrix is positive definite?
- Is there any specific relationship among the determinant of leading principal submatrices of a tridiagonal matrix?
- Linear Algebra: tri-diagonal matrix problem.
Trending Questions
- Induction on the number of equations
- How to convince a math teacher of this simple and obvious fact?
- Find $E[XY|Y+Z=1 ]$
- Refuting the Anti-Cantor Cranks
- What are imaginary numbers?
- Determine the adjoint of $\tilde Q(x)$ for $\tilde Q(x)u:=(Qu)(x)$ where $Q:U→L^2(Ω,ℝ^d$ is a Hilbert-Schmidt operator and $U$ is a Hilbert space
- Why does this innovative method of subtraction from a third grader always work?
- How do we know that the number $1$ is not equal to the number $-1$?
- What are the Implications of having VΩ as a model for a theory?
- Defining a Galois Field based on primitive element versus polynomial?
- Can't find the relationship between two columns of numbers. Please Help
- Is computer science a branch of mathematics?
- Is there a bijection of $\mathbb{R}^n$ with itself such that the forward map is connected but the inverse is not?
- Identification of a quadrilateral as a trapezoid, rectangle, or square
- Generator of inertia group in function field extension
Popular # Hahtags
second-order-logic
numerical-methods
puzzle
logic
probability
number-theory
winding-number
real-analysis
integration
calculus
complex-analysis
sequences-and-series
proof-writing
set-theory
functions
homotopy-theory
elementary-number-theory
ordinary-differential-equations
circles
derivatives
game-theory
definite-integrals
elementary-set-theory
limits
multivariable-calculus
geometry
algebraic-number-theory
proof-verification
partial-derivative
algebra-precalculus
Popular Questions
- What is the integral of 1/x?
- How many squares actually ARE in this picture? Is this a trick question with no right answer?
- Is a matrix multiplied with its transpose something special?
- What is the difference between independent and mutually exclusive events?
- Visually stunning math concepts which are easy to explain
- taylor series of $\ln(1+x)$?
- How to tell if a set of vectors spans a space?
- Calculus question taking derivative to find horizontal tangent line
- How to determine if a function is one-to-one?
- Determine if vectors are linearly independent
- What does it mean to have a determinant equal to zero?
- Is this Batman equation for real?
- How to find perpendicular vector to another vector?
- How to find mean and median from histogram
- How many sides does a circle have?
Some general insight. A tridiagonal symmetric matrix would look like $$\begin{bmatrix}\alpha_1 & \beta_1 \\ \beta_1 & \alpha_2 & \beta_2 \\ & \beta_2 & \alpha_3 & \beta_3 \\ && \beta_3 & \alpha_4 \end{bmatrix}.$$ Firstly, generate each $\beta_i$ as real. If you want the matrix to be positive definite, you have to ensure that $\alpha_i > |\beta_{i-1}| +|\beta_i|$ (diagonal row-dominance). Consider generating some numbers $\varepsilon_i$ as strictly positive, then $\alpha_i := |\beta_{i-1}| +|\beta_i| +\varepsilon_i$. The corner entries are easier than that: $\alpha_1 := |\beta_1| +\varepsilon_1$ and $\alpha_n := |\beta_{n-1}| +\varepsilon_n$.