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

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -