rolling dice problem in cody..........error in this code??

I need help with this code:
function [x1,x2] = rollDice()
x1 = round(randi(6));
x2 = round(randi(6));
end

 채택된 답변

Geoff
Geoff 2012년 5월 16일

0 개 추천

Don't use round: randi already returns integers.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Random Number Generation에 대해 자세히 알아보기

질문:

2012년 5월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by