so I am able to make the deck but I need to take this and get the suit out (second number) to find what suit it is and count it
Deck = [];
for rank = 1:13
for suit = 1:4
cardval = [rank suit];
Deck = [Deck, {cardval}];
end
end
Shuffled = Deck(randperm(length(Deck)));
Draw = Shuffled(1,1);

 採用された回答

James Tursa
James Tursa 2021 年 2 月 14 日

0 投票

Draw{1}(1) is the rank and Draw{1}(2) is the suit.

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCard games についてさらに検索

製品

リリース

R2020b

質問済み:

2021 年 2 月 14 日

回答済み:

2021 年 2 月 14 日

Community Treasure Hunt

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

Start Hunting!

Translated by