On Matlab annoyances and alternatives

Matlab has many problems as a programming language. Some could be easily fixed, some probably not. Some are very real and important issues that discourage advanced programmer from using it. This is one of the reasons why a large number of people are migrating to Python.

I still believe Matlab is very valuable for a lot of reasons. First, Matlab has reached the “Critical Mass”, especially in my field. Second, its private and commercial origin is both its default (cost of the software) and advantage as it enforces a uniform and properly organized structure to the whole system. The recent and important progress of Python (thanks to Numpy and Scipy packages) is in all cases a good thing as it diversifies the computational offer to scientists. The years of Matlab hegemony seem to be coming to an end.

Still, I would like to discuss here these annoyances that convinced people to move over to Python. I will probably follow this line in a couple posts. Eventually, I will suggest a solution around if I find one.

I recently came across one of them that is good to keep in mind.

You probably all know that whatever Matlab is doing, you can stop it using CTRL+C.

Let’s assume you have this code running :


This is a very simple error management system as I recently talked about. Well, you would be surprised, but if your user press CTRL+C while doing a try statement, Matlab just stops here. It does not go to your catch as you would expect. This is a design choice from Mathworks.

Fine, but this is an annoyance when you program a GUI, for instance. If you disable your GUI during calculations, there is no way to turn it back if CTRL+C is pressed. You have to start the whole thing again!

This entry was posted in Annoyances. Bookmark the permalink.

2 Responses to On Matlab annoyances and alternatives

  1. Chandrakanth says:

    I somehow feel it makes more sense to do what matlab does on Ctrl+C. Never been annoyed by that behaviour as I keep my catch statements for exceptions and see no good reason why I would need to be inside catch upon Ctrl+C.

    • Jerome says:

      I am not sure I will agree. Ctrl-C is a pretty serious stop of your program. You might want to be able to handle this gracefully. You can leave file opened this way without even knowing about it.

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.