MATLAB: Randi Vector with constant increments randi vector array increment How do you create a random vector in between two lengths with constant increment increases. ex: vec1= 10,000 to 100,000 in length with increments of 10,000 Best Answer Set the limits as inc = 10000 % constant incrementThen two random values as lower and upper limits of the vectorran_values = sort([randi(10000), randi(100000])); % two random values sorted to get low and upper limitsvect = ran_values(1):inc:ran_values(2) % vector% note : upper limit must be greater than increment Related SolutionsMATLAB: Chose a random integer between an upper and lower limit. c=randi([a b]) MATLAB: Define a vector y to have 10 random values. y = rand(1,10)%ory = randi([1 10],1,10) Related QuestionAbout rand and randi commandRandom fun.
Best Answer