how to increment an exponential in a diagonal

2 ビュー (過去 30 日間)
Harnoor
Harnoor 2022 年 7 月 15 日
回答済み: KSSV 2022 年 7 月 15 日
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.

回答 (1 件)

KSSV
KSSV 2022 年 7 月 15 日
A = exp(-1./(1:19)) ;
iwant = diag(A)

カテゴリ

Help Center および File ExchangeOperating on Diagonal Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by