How create a random sequence
조회 수: 9 (최근 30일)
이전 댓글 표시
Hi, I want to create a random sequence of 10 elements with values +- 2.How can i do it?
BR,
José Manuel.
댓글 수: 1
the cyclist
2013년 11월 24일
Do you want only values of -2 and 2, or continuous values uniformly in between, like -1.732 and 0.365?
채택된 답변
the cyclist
2013년 11월 24일
편집: the cyclist
2013년 11월 24일
Just -2 and 2:
R = 4*round(rand(1,10)) - 2;
Continuous:
R = 4*rand(1,10) - 2;
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Random Number Generation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!