MATLAB: Raise a scalar to a descending series of powers in an array

MATLABmatrixpower

I'm trying to compute a series of powers of a scalar.
This seems to work but the result is not what I expected:
0.8^1:3
ans =
0.8000 1.8000 2.8000
I expected:
ans =
0.8000 0.6400 0.5120
(It looks like it is returning 0.8:3)
This therfore doesn't work either:
0.8^3:-1:1
ans =
1×0 empty double row vector
Neither does this
0.8^(3:-1:1)
Error using ^ (line 51)
Incorrect dimensions for raising a matrix to a power. Check that the matrix is square and the power is a scalar. To perform elementwise matrix powers, use '.^'.
Neither of these work
0.8^[3 2 1]
0.8^[1 2 3]
Error using ^ (line 51)
Incorrect dimensions for raising a matrix to a power. Check that the matrix is square and the power is a scalar. To perform elementwise matrix powers, use '.^'.
So, how do I compute the scalar to the power of a series of descending values?

Best Answer

Here is the correct answer I think. Element-wise operation:
0.8.^(3:-1:1)
Related Question