Matlab Bingo Game card

조회 수: 5 (최근 30일)
Karanpreet Singh
Karanpreet Singh 2019년 11월 27일
댓글: Karanpreet Singh 2019년 11월 30일
How to create a bingo card in matlab?
need Code...
  댓글 수: 3
Karanpreet Singh
Karanpreet Singh 2019년 11월 27일
I am trying to genrate random numbers to create a bingo card using randperm function. so, the numbers dont repeate itself.but its not working.
A = randperm(15,5)'
C = randperm([16,30],5)'
D = randperm([31,45],5)'
E = randperm([46,60],5)'
F = randperm([61,75],5)'
Image Analyst
Image Analyst 2019년 11월 27일
Nice, Karanpreet, but why not put your answer below in the official "Answers" section so you can get credit for it if he "Accepts" your answer?

댓글을 달려면 로그인하십시오.

채택된 답변

Steven Lord
Steven Lord 2019년 11월 27일
randperm accepts a scalar (just one number) as its first input.
You could generate a set of random numbers from 1 to 15 and use those to select from a vector of allowed values for each letter using indexing. Another approach would be to figure out how to map numbers from 1 to 15 into the set of allowed values for a letter (61 to 75 for O, as one example.)

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by