how to increment an exponential in a diagonal

2 vues (au cours des 30 derniers jours)
Harnoor
Harnoor le 15 Juil 2022
Réponse apportée : KSSV le 15 Juil 2022
I want to create a matrix with exponents in the diagonal. The first exponent is e^-1, then e^-1/2, e^-1/3... all the way to e^-1/19.

Réponses (1)

KSSV
KSSV le 15 Juil 2022
A = exp(-1./(1:19)) ;
iwant = diag(A)

Catégories

En savoir plus sur Operating on Diagonal Matrices 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