Rolling dice multiple times?

조회 수: 4 (최근 30일)
Brian Tiffman
Brian Tiffman 2016년 1월 22일
답변: Walter Roberson 2016년 1월 22일
I want to have my code to roll five dice once, which I will do using the randi command. I then want to reroll certain dice two more times. For example, after the first roll maybe I want to keep dice 2 and 4, but I want to reroll the rest. Can someone give me some insight into how I would do this. I just want some guidance toward this. Your help is appreciated. Thanks.

답변 (1개)

Walter Roberson
Walter Roberson 2016년 1월 22일
Hint:
rolled(columns_to_discard) = new_random_values;

카테고리

Help CenterFile Exchange에서 Word games에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by