Matrix Poker

Game: fill 5x5 matrix with random numbers to get maximum score by forming premium combinations.
Updated 28 Oct 2016

View License

Matrix Poker is a combination of hazard and combinatorial thinking. The game consists in filling the game board with random numbers (from 1 up to 13) to get a maximum score by forming premium combinations in rows, columns, and on two diagonals.
To start the game, run MATPOKER.M. You will see 25 empty green cells surrounded by 24 gray cells. Above them there are three buttons ("New", "Count", "Help"), and a green cell with a random number between 1 and 13.
Look at that number in the upper-left corner of the game window and click on an empty cell to place the number. Repeat this step until all green cells are filled by numbers, and try to create as many premium combinations as
possible. After filling all cells, click on "Count" button to see your score. The abbreviations of formed premium combinations, and their values will appear in surrounding gray cells.
To see the rules and the table of premium combinations in your default web browser, click on "Help" button.
To start a new game, click on "New".

(C) 2002-2003, Igor Podlubny (corresponding author,, Peter Konecny (


September 22, 2003:
Slightly updated to work properly with Matlab R11, R12, and R13.

October 6, 2016:
The code has been updated by Matej Mikulszky,
student, Technical University of Kosice, BERG Faculty,
to make the game window resizable.

Cite As

Igor Podlubny (2024). Matrix Poker (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2009a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Signal Processing in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!


Version Published Release Notes

Removed rudimentary 'clear' command, thanks to Carl Witthoft's comment.

The code has been updated to make the game window resizable.

Little text corrections.