My question is if there is a way to create a vector of zeros
vec = 0 0 0 0 0 0 0 0
and specify a position lets say from the second until the fourth element to be ones.
vec = 0 1 1 1 0 0 0 0
Is there a quick way of doing this in Matlab avoiding loops?
Best Answer