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 CenterFile Exchange에서 Operating on Diagonal Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by