MATLAB: Buildind special vector? V(3)=V(6)=V(9)…=0

vectorvectorizationvectors

How can I build
V=[1 1 0 1 1 0 1 1 0 1 1 0….]vector.I want to put N value and it will reply me V vector..
Elements fo V will be V(3)=V(6)=V(9)…=0

Best Answer

Another guess:
V = ones(1, N);
V(3:3:end) = 0;