MATLAB: Generate logical vector of specific pattern of numbers

logical vector

Hi, I want to generate numbers with the following pattern: [2 3 4.75 5.75 7.5 8.5 10.25 11.25]
The format will be n+1 then n+1.75 then n+1 then n+1.75 and so on.
n starts from 2 and the calculation of n always consider the previous calculated value of n.
Please assist me.
Thanks a lot.

Best Answer

cycles = 10;
pattern = cumsum([2 repmat([1 1.75], 1, cycles)]);