Question
I need to know how to create the following vectors inmatlab Each vector needs to have 1000 numbers in that repeat in thefollowing order. Is there some type of built in matlab function that allowsthese vectors to be repeated. vector_1=[1,0,1,0,1,0,...........]; vector_2=[0,1,2,3,4,5,0,1,2,3,4,5,0,1,........]; Thanks in advance. I need to know how to create the following vectors inmatlab Each vector needs to have 1000 numbers in that repeat in thefollowing order. Is there some type of built in matlab function that allowsthese vectors to be repeated. vector_1=[1,0,1,0,1,0,...........]; vector_2=[0,1,2,3,4,5,0,1,2,3,4,5,0,1,........]; Thanks in advance.
Explanation / Answer
Dear, Creating repeated vectors can done asfollows, Creating vector_1 = {1,0,1,0,1,0....... } >>for j = 1 : 500 >>v = [ 1 0 ] End >> Creating vector_2 = {0,1,2,3,4,5,0,1,2,3,4,5,.......... } >>for j = 1 : 166 >>v = [0 1 2 3 4 5] end >> " I hope this will help you "