Use element-wise division:
n = 1:100;
format short
Seq = 1./n
producing:
Seq =
1.0000 0.5000 0.3333 0.2500 0.2000 0.1667 0.1429 0.1250 0.1111 ...
alternatively:
producing:
Seq =
1 1/2 1/3 1/4 1/5 1/6 ...
EDIT — (17 Jan 2020 at 17:11)
Forgot to include the plot call.
Here it is:
This is the same as:
figure
plot((1:numel(Seq)), Seq)
grid
Best Answer