If I do not want to plot an actual graph, and just display text of different colors as if it was written in a text editor or something similar how would I do that? So I wrote this program that deals random cards out. The program works great, but I don't know how to do the display. Here is the program though really all I am asking is for help with the figure.
function []=myShowHand(cards,PlayerName)for k = 1:length(cards) if cards(k) == 1 cards(k) = 13; elseif cards(k) == 14 cards(k) = 26; elseif cards(k) == 27 cards(k) = 39; elseif cards(k) == 40 cards(k) = 52; else cards(k) = cards(k) - 1; end % nested if
end % for loop
cards = sort(cards,'descend');A = find(cards <= 13);AA = cards(A); %clubs
B = find(cards >= 14);BB = cards(B);C = find(BB <=26);CC = cards(C); %diamonds
D = find(cards >= 27);DD = cards(D);E = find(DD <=39);EE = cards(E); %hearts
F = find(cards >= 40);FF = cards(F); %spades
clubs = AA;diamonds = CC;hearts = EE;spades = FF;deck = '23456789TJQKA23456789TJQKA23456789TJQKA23456789TJQKA';clubs = deck(clubs);diamonds = deck(diamonds);hearts = deck(hearts);spades = deck(spades);figureaxis offtext(1,1,'\spadesuit')text(1,2,'\heartsuit')text(1,3,'\diamondsuit')text(1,4,'\clubsuit')end % function
Best Answer