image thumbnail
from Texas Holdem by Stefan Krause
This is a fully functional Texas Holdem program.

output=dealcards(deck,nop,nopind,type,dealer)
function output=dealcards(deck,nop,nopind,type,dealer)

if type==1
	k=1;
	for i=1:2
		for j=1:nop
            hands{j}{i}=deck.cards{k};
            rawhands{j}{i}=deck.rawcards{k};
            k=k+1;
            hands{j}{3}='';
        end
	end

    hands{dealer(1)}{3}='(Dealer)';
    hands{dealer(2)}{3}='(Small Blind)';
    if nop>2
        hands{dealer(3)}{3}='(Big Blind)';
    elseif nop==2
        hands{dealer(1)}{3}='(Dealer / Big Blind)';
    end
        
    
    output{1}=hands;
    output{2}=rawhands;
end



if type==2
    k=(nop*2)+2;
    for i=1:3
        community{i}=deck.cards{k};
        rawcommunity{i}=deck.rawcards{k};
        k=k+1;    
    end
    output{1}=community;
    output{2}=rawcommunity;
end

if type==3
    k=(nop*2)+6;
    community=deck.cards{k};
    rawcommunity=deck.rawcards{k};
    output{1}=community;
    output{2}=rawcommunity;
end

if type==4
    k=(nop*2)+8;
    community=deck.cards{k};
    rawcommunity=deck.rawcards{k};
    output{1}=community;
    output{2}=rawcommunity;
end

Contact us at files@mathworks.com