Buildind special vector? V(3)=V(6)=V(9)...=0

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

1 Comment

You did not explain the relation between N and the result

Sign in to comment.

 Accepted Answer

Jan
Jan on 6 Mar 2013
Edited: Jan on 6 Mar 2013
Another guess:
V = ones(1, N);
V(3:3:end) = 0;

More Answers (1)

V=[1 1 0 1 1 0 1 1 0 1 1 0]
N=3
V(N:N:end)=0

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Asked:

on 6 Mar 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!