Randi Vector with constant increments
조회 수: 6 (최근 30일)
이전 댓글 표시
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
채택된 답변
Bhaskar R
2019년 11월 8일
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!