Question: MATLAB Function Name: poker Inputs: - (double) a vector representing someone's poker hand Output: - (char) a character representing the type of poker hand Description:

MATLAB

MATLAB Function Name: poker Inputs: - (double) a vector representing someone's poker

Function Name: poker Inputs: - (double) a vector representing someone's poker hand Output: - (char) a character representing the type of poker hand Description: - 'Royal Flush': a hand made up of the cards [14 13121110] - 'Four of a Kind': a hand made up of four cards of the same rank (ex: [11 11 13 11 11]) - 'Full House'. a hand with three of a kind with a pair (ex: [10,10,9,10,9] ) - 'Straight': Five cards that form a sequence (ex: [11,12,10,8,9]) - 'Three of a Kind': Three cards of the same rank (ex: [13773]) - 'Pair': two cards of the same rank (ex: [148144] ) Notes: - Notice a Full House is made up of Three of a Kind and a Pair; however, you should output Full House because this is the highest value. - The inputted order of the cards doesnt matter. Pairs and Straights can still exist even if they aren't initially adjacent. Hints: - Think about how you can get cards that are equal next to each other and then check to see how many equal cards there are. % Examples (These match the ones in the bulleted list above) out1 =poker([1413121110]) \%'Royal Flush' out2 =poker([1111131111])% Four of a Kind" out3 =poker([10,10,9,10,9])%Fu11 House. out4 =poker([11,12,16,8,9])% Straight' out5 =poker([137737])% "Three of a Kind' out6 =poker([431234]) \%"Two Pair' out7 =poker([1481447])% Pair " outs =poker([12346])% "Nothing

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!