MATLAB: %How can i create this vector? Please I need your help.

matrix manipulationvector

Vector = [1 1 1 1 1 0 0 2 2 2 2 2 0 0 3 3 3 3 3 ...];

Best Answer

B = 1:50;
Vector = repelem(B, 7);
D = 0;
for j = 1:size(Vector)
D = D +1;
if (mod(D, 7) == 0 || mod(D, 7)==6)
Vector(j) = 0;
end
end