MATLAB: Skip counting numbers and including the remainder

linspaceskip counting

I want to skip count 1 to 100 by 4's.
So
1:4:100
The output is until 97. I want to include the 100 in the result.
Example: 1:8:88 gives a result until 81. I want to include 88.
How do I do this? Thanks

Best Answer

n = 100;
step1 = 4;
seq = unique([1:step1:n,n]);