DICE: launch N times
이전 댓글 표시
I get N dice of which each face has a number from 1 to 6. I'd like representing all the possibility with a matrix in which each column contains the N value of the dice.
Can you help me to write a script to do this task using only function in the Matlab suite and not other toolbox?
Thanks Marco
답변 (2개)
Ahmad Moniri
2017년 2월 14일
0 개 추천
I think you should look at the combntns function.
https://uk.mathworks.com/help/map/ref/combntns.html
Torsten
2017년 2월 14일
https://de.mathworks.com/matlabcentral/fileexchange/24325-combinator-combinations-and-permutations
N=...;
combinator(6,N,'p','r');
Best wishes
Torsten.
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!