Randi Vector with constant increments
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Chelles Rees
am 8 Nov. 2019
Beantwortet: Bhaskar R
am 8 Nov. 2019
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
0 Kommentare
Akzeptierte Antwort
Bhaskar R
am 8 Nov. 2019
Set the limits as
inc = 10000 % constant increment
Then two random values as lower and upper limits of the vector
ran_values = sort([randi(10000), randi(100000])); % two random values sorted to get low and upper limits
vect = ran_values(1):inc:ran_values(2) % vector
% note : upper limit must be greater than increment
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Shifting and Sorting Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!