Ranges with different step size for odd and even steps in MATLAB -
what fastest , simplest way generate array like
[0, 1, 3, 4, 6, 7, 9, 10, ...]
in matlab?
you can obtain cumulative sum of vector of steps (in case [1 2 1 2 1 2 1 2 ...]
). example:
x = cumsum([0, repmat([1 2], 1, 4)]) x = 0 1 3 4 6 7 9 10 12
Comments
Post a Comment