MATLAB: How to create array with unequal spacing

arraysunequal spacing

I want to create an array with unequal spacing. I have h = 1 1/2 1/4 1/8 ….. 2^-60.
Every second entry in this array is 1/2 of the last one. I only know, how to make arrays with equal spacing.
a = 1:5:40
But how do I create array that gets halved with every entry?

Best Answer

h = 2.^-(0:60);
Related Question