Extracting data form a single cell

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
Draw{1}(1) is the rank and Draw{1}(2) is the suit.

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Card games 的更多信息

产品

版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by