Question: how do i get the exponential of diagonal matrix?

Hi, I have a diagonal matrix "B", which is for example [[2,0,0],[0,8,0],[0,0,4]]

I would like to have 1.5 to the power of each position in the diagonal matrix.

For example [[1.5^2,0,0],[0,1.5^8,0],[0,0,1.5^4]].

I try to write it as follows but fail :

Test 1
for j from 1 to 3 do
end do:

Test 2

Please help. Thanks.

Please Wait...