making a sequence of numbers in octave and matlab

4.6k Views Asked by At

I know I can make a sequence of numbers in matlab / octave using x=1:1:5 and it will give me 1,2,3,4,5 but how can I get a sequence to be

1,1/2,1/4,1/6,1/8,1/10...
2

There are 2 best solutions below

0
On BEST ANSWER

This should work:

1./[1,2.*(1:1:5)]
2
On

Try

1./[1,(2:2:20)]

......................