Creating a structure of a deck of cards with three fields: suit, card, and card value
    3 views (last 30 days)
  
       Show older comments
    
I am trying to fill a structure array with fields suit, card, and cardValue. My structure is supposed to have 52 cards which have a string value that indicates their suit, a string value that indicated the card(Ace, King, 2, 7, etc.) and a value for that card(2,3,...,13,14 for 2,3,King,Ace). I am having trouble population my structure and would appreciate any help! Thank you
1 Comment
  Bob Thompson
      
 on 5 Nov 2019
				What kind of trouble are you having? Are you running into specific errors? What does your code look like so far?
I would think this would generally be fairly easy. You could index the different cards within the structure fairly easily, but entering them would probably be a pretty manuel job unless you had some kind of array which contains all the information already (even if it's not actually in Matlab).
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
