Extracting data form a single cell

조회 수: 3 (최근 30일)
Cole  Kleinow
Cole Kleinow 2021년 2월 14일
답변: James Tursa 2021년 2월 14일
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개)

카테고리

Help CenterFile 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