Matlab script that randomly selects a card from a deck of 52
7 ビュー (過去 30 日間)
古いコメントを表示
I need to write a program using Matlab that randomly selects a single card(from a full deck 52 cards) and print the result out, i.e. ace-spades, 5-hearts, king-diamonds,etc. Thank you in advance
0 件のコメント
回答 (2 件)
bio lim
2016 年 12 月 2 日
What have you done so far?
What you can do is first you define a cell array that contains each card of the deck. Then you can use randi to generate a random index into your cell array. Then, you can use print out the the card that belongs to the index.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Simultaneous and Synchronized Operations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!