generate random integer number with a specific mean

조회 수: 1 (최근 30일)
carolina travassos
carolina travassos 2021년 6월 11일
답변: Bjorn Gustavsson 2021년 6월 11일
how to generate random integer number in a fixed range in MATLAB with a specific mean? E.g. 10 random integers between 1 and 3 (i.e. possibilities are 1, 2 or 3) and mean=2.
Thanks!

답변 (1개)

Bjorn Gustavsson
Bjorn Gustavsson 2021년 6월 11일
Have a look at the help and documentation of randi and then try and test some things. Finally have a deep think about what your demand that the mean is specified actually means if it is to be taken as the specific mean of each set of 10 points and what it means to have the expected mean of 10 points.
HTH

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by