How to create a random data set from the possible values?
이전 댓글 표시
I have eleven inputs, each input have several values. How can I create five hundred distinct sets of variables at random from the possible input values. (like following image)

채택된 답변
추가 답변 (1개)
Roger Stafford
2016년 4월 14일
Let L be a column vector with eleven integers, each the count of the number of possible values in the corresponding set of the eleven sets.
L = [10;7;5;6;4;5;5;10;7;5;5]; % The number of possibilities in each set
I = ceil(L.*rand(11,1)); % I has random indices for each set
The vector I will then have random indices that can select one out of each of the sets of values you have listed.
카테고리
도움말 센터 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!