How to create a Toeplitz matrix?

5 vues (au cours des 30 derniers jours)
Omar B.
Omar B. le 11 Fév 2020
Commenté : Omar B. le 11 Fév 2020
How to create a symmetric positive definite Toeplitz matrix with entries ?

Réponse acceptée

Jon
Jon le 11 Fév 2020
Modifié(e) : Jon le 11 Fév 2020
You can use MATLAB toeplitz function for this.
See the documentation by typing doc toeplitz on the command line.
Since your toeplitz matrix is symmetric you just need to define the first row, let's call it r and then use
A = toeplitz(r)
Using the formula you have given it should be quite straight forward to assign r. In your formula just set i = 1 since you just want to define the first row, and then let j go from 1 to 500. So something like
i = 1;
jCol = 1:500
r = 1./(1 + abs(1 - jCol)) % note ./ does element by element division
A = toeplitz(r)
  1 commentaire
Omar B.
Omar B. le 11 Fév 2020
Thank you very much. I got it.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Multidimensional Arrays dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by