Gaming in Matlab

I have recently been looking into how to make very advanced and beautiful GUIs in Matlab.

The issue with this is that in Matlab, GUIs seem to be somehow limited compared to other languages. Historically, Matlab was supposed to be a numerical plate-form to quickly put together new ideas for computation. So the GUI is a nice bonus, but not its primary focus.

To get inspiration on how to push Matlab capabilities, I thought I would look into a domain where the GUI is the primary focus : GAMING.

Surprisingly, there are some decent games in Matlab.

Don’t get me wrong. Nothing compared to Call of Duty, but at least a very good source of inspiration to do real-time processing and beautiful usage of Matlab figure capabitilites. Keep in mind that no professional programmer in Gaming has seriously considered doing this. So these games are done by passionate and dedicated folks.

Let me show some of these games. If you found one that should be in this list, let me know.

Tetris is a THE classic in gaming. And apparently you can do a pretty decent version of Tetris in Matlab. There are several ones on Matlab file exchange. This is one that I tested and it works great!

This program works by using a timer object to update the display. It captures your keyboard to modify each frame. It uses patch objects to create blocks and move them around. The code is very clear and organized.

Stellaria is a shooting game implemented in Matlab. It looks pretty decent if you compare it to a game from the 80s. I must confess I was not impressed by the code itself. Lots of global variables. It is a little bit hard to read but it works. No timer here. It works with a WHILE loop that goes as fast as it can and updates the frames as the computation progresses. Some pretty nice effects happening in the figure window, compared to what you usually see in graphs.


Risk is a classic board game. Here we have a pretty nice usage of all standard GUI controls to create an environment a little bit more appealing than the usual. 

I am still looking for Games with a very polished interface. Let me know if you know one.

This entry was posted in Intermediate, Making interfaces. Bookmark the permalink.

14 Responses to Gaming in Matlab

  1. I am seriously impressed!

  2. lakshmanan says:

    Excellent unbelivale

  3. Coolpk says:

    good work

  4. says:

    The best way to get deals having current codes is always to seek by time.

  5. loneranger says:

    Where can I find the codes of these games? pls. reply as soon as possible

  6. 86Rhea says:

    I have noticed you don’t monetize your blog, don’t waste your traffic, you can earn extra cash every month because you’ve got high quality content.
    If you want to know how to make extra bucks, search for: best adsense alternative Wrastain’s

  7. Thomas says:

    Great post! Have nice day ! 🙂 jxova

  8. Seid Ahmed says:

    Hello Dears

    I need mathlab codes for repeated game for inter-operator spectrum sharing.

    please help me by giving this.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.