Deal 4 cards from the deck at once. Give the dealer the first two and the player the next two.
As written, your code can give the dealer the same card twice. Instead generate random numbers from 1 to 52 without replacement (you can use randperm to do this) then determine which rank and suit pair each of those numbers represents.
Hint: If you were to arrange the cards in a matrix like the example set in the "Rank and Color" section of the Wikipedia page for a 52-card deck, what linear index refers to, say, the 9 of spades? How about the 9 of hearts? The 10 of spades? Can you find a way, given a linear index, to compute which rank and suit that index represents?
