Extracting data form a single cell

3 visualizaciones (últimos 30 días)
Cole  Kleinow
Cole Kleinow el 14 de Feb. de 2021
Respondida: James Tursa el 14 de Feb. de 2021
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);

Respuesta aceptada

James Tursa
James Tursa el 14 de Feb. de 2021
Draw{1}(1) is the rank and Draw{1}(2) is the suit.

Más respuestas (0)

Categorías

Más información sobre Card games en Help Center y File Exchange.

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by