Rank: 212 based on 984 downloads (last 30 days) and 8 files submitted
Personal Profile:

If you're interested in MATLAB's Statistics Toolbox, check out some articles I have written on the topic over at http://www.blinkdagger.com/category/statistics.

Professional Interests:
stats, numerical methods, image processing, monte carlo, game theory

 

Watch this Author's files

 

Files Posted by Rob View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
23 Mar 2009 Screenshot REN, a multiple file renaming utility with GUI REN = renaming utility with a GUI. It was inspired by Quan's post on Blinkdagger.com Author: Rob Slazas file handling, rename, quan, blinkdagger 116 0
12 Sep 2008 Simple String Cleanup Utility Simple utility function that cleans up stray characters and spaces from strings so they can be used Author: Rob Slazas character, cleanup, clean, strings, string, format 154 0
02 Sep 2008 Screenshot Poker hand ranker Function that evaluates poker hands, returns ranks and text descriptions. Author: Rob Slazas hand, doug hull, lazyweb, poker, rank, games 138 13
  • 4.5
4.5 | 4 ratings
21 May 2008 Screenshot Place one 2D matrix inside another Places a 2D matrix B into a larger 2D matrix A Author: Rob Slazas place put 2d matrix i..., matrices 107 1
  • 5.0
5.0 | 1 rating
20 May 2008 Mosquito tone generator Manipulates a sine function and plays it as .wav audio. Author: Rob Slazas sound, mosquito ringtone ton... 118 0
Comments and Ratings on Rob's Files View all
Updated File Comment by Comments Rating
27 Feb 2009 Poker hand ranker Function that evaluates poker hands, returns ranks and text descriptions. Author: Rob Slazas MuffinMan

Great starting point for a hand evaluator however still has issues and does not rank all hands correctly. I discovered this several months ago but didn't want to bother with registering to post a reply. After a coworker mentioned using this evaluator to prove an argument, I mentioned the shortcomings. Unfortunately now I can't remember the cases it fails at, but I recall the error is due to the arbitrary method of ranking hands by hashing the card numbers. In some cases hands that should not have the same rank are hashed to the same value. A easy test is to use combs=nchoosek([1:52],5); ranks=rankp(combs,5); unique(ranks) and you will find that all possible hands gives 6987 possible ranks using rankp, which is incorrect, and instead you should get 7462.

Once the total ranks checks out, you should test and find that there are 10 straight flushes, 156 four of a kinds and full houses, 1277 flushes, 10 straights, 858 trips and two pairs, 2860 pairs, and 1277 high card ranks. Otherwise, there is still an error.

As an aside, the 2+2 evaluator can do unordered evaluations of 5-7 card hands, at blazing speeds, and can easily be ported to Matlab.

27 Feb 2009 Poker hand ranker Function that evaluates poker hands, returns ranks and text descriptions. Author: Rob Slazas MuffinMan

30 Aug 2008 Poker hand ranker Function that evaluates poker hands, returns ranks and text descriptions. Author: Rob Slazas S., Rob

Thanks Tim C., there was a hole in the conditional statement for hands with pairs. Nice catch, the update has it fixed.

22 Aug 2008 Poker hand ranker Function that evaluates poker hands, returns ranks and text descriptions. Author: Rob Slazas C, Tim

Pretty neat! But I can't seem to wrap my head around what's happening for the test case below. Using the input:

>> trick = [21, 22, 40, 33, 26, 42, 1, 7];
>> [ranks,descriptions,usedcards,unusedcards] = rankp(trick,5);

yields:

>> descriptions{1}
ans =
    'Two Pairs, Ace's and 8's with a(n) King'
>> usedcards
usedcards =
    21 40 33 1 7

But there are no kings in the 'trick' vector, let alone in the 'usedcards' output. Any hints where this is coming from? I'm using R2007a.

27 May 2008 Place one 2D matrix inside another Places a 2D matrix B into a larger 2D matrix A Author: Rob Slazas Le, Khai

Great!

Top Tags Applied by Rob
3d, annotation, blinkdagger, character, circular
Files Tagged by Rob View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
23 Mar 2009 Screenshot REN, a multiple file renaming utility with GUI REN = renaming utility with a GUI. It was inspired by Quan's post on Blinkdagger.com Author: Rob Slazas file handling, rename, quan, blinkdagger 116 0
12 Sep 2008 Simple String Cleanup Utility Simple utility function that cleans up stray characters and spaces from strings so they can be used Author: Rob Slazas character, cleanup, clean, strings, string, format 154 0
02 Sep 2008 Screenshot Poker hand ranker Function that evaluates poker hands, returns ranks and text descriptions. Author: Rob Slazas hand, doug hull, lazyweb, poker, rank, games 138 13
  • 4.5
4.5 | 4 ratings
21 May 2008 Screenshot Place one 2D matrix inside another Places a 2D matrix B into a larger 2D matrix A Author: Rob Slazas place put 2d matrix i..., matrices 107 1
  • 5.0
5.0 | 1 rating
20 May 2008 Mosquito tone generator Manipulates a sine function and plays it as .wav audio. Author: Rob Slazas sound, mosquito ringtone ton... 118 0
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com