generating random values with condition
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi all
how to generate 12 random values, each number can be in the range from 0.01 to 1 but the summation of each successive 4 numbers must be equal to 1.
댓글 수: 1
Image Analyst
2020년 1월 15일
This is quirky enough that it sounds very much like homework. And I'm sure that you can't ethically turn in our code as your own, so read this link, and read the documentation on rand(). And realize that you can divide and multiply sets of 4 numbers to get new, scaled numbers.
답변 (1개)
James Tursa
2020년 1월 15일
You could use this FEX submission by Roger Stafford for each 4 number block:
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Audio and Video Data에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!