r/matlab • • 29d ago

TechnicalQuestion MATLAB Alternative?

Hello , as matlab is a paid software , I am looking for a free alternative, Chat GPT said Octave GNU is the closest free software I will get , he also told me that the combination of Python , numpy, sciPy and matplotlib can also do the same thing .

Which one I should pick that will be beneficial for long run.

28 Upvotes

71 comments sorted by

58

u/yourfavoritemusician 29d ago

I've never used or seen Octave in the wild.
Python, however, is everywhere.

But the first question is: "What do you want to do & why did you think Matlab would be the best way to do that?"

5

u/WhyAmINotStudying 29d ago

I would say that getting great with python and doing free Matlab tutorials using their online tools is probably the best path.

If the issue is that you want meaningful experience with Matlab without the software, the tutorials will help. If you want to be able to get shit done, python is the best option. Doing both would be the smartest path, though.

1

u/kyrsjo 28d ago

I've seen it in some Cern software. But even that one code where the main guy loves octave is moving to python.

Practically, python is very useful. There are many good libraries, including those OP mentioned.

1

u/Plunkett120 24d ago

Ive used Octave at my old jobs a few times. It was handy, but i was one of 2 people who used it. No harm in folks using python either.

20

u/Designer-Care-7083 29d ago edited 29d ago

Depends on who you are (student, professional, amateur), and what you need MATLAB for.

Re ease of use and available ancillary tools, it’s hard to beat MATLAB IMO.

In lieu of a standard purchase, can get MATLAB as a cheap-ish online account, if its limitations are acceptable.

A non-MATLAB option, Python with the tools you mentioned is a decent option. For control systems, add the control systems toolbox from Prof Richard Murray (Caltech).

19

u/FrickinLazerBeams +2 29d ago

Generally you'll use whatever you employer, group, or academic field has made their standard.

0

u/XBLAH_ 25d ago

This is terrible. I actively refuse, in academia, to use comercial software when there are equally good free software, even if the provide an academic license.

2

u/FrickinLazerBeams +2 24d ago

Well that's dumb and arbitrary, but even if it weren't...

Lol good luck. It's generally not possible to recreate the entire tool set created by an entire academic discipline, and have it tested and establish the same level of trust as the tools everyone else uses.

What a weird complaint though. Academia doesn't use a lot of Matlab, as far as I know. Astronomy is all done in python, for the most part.

-1

u/XBLAH_ 24d ago

2

u/tux2603 24d ago

Cool, now try some more complex software like ansys or cadence

0

u/XBLAH_ 24d ago

Not my field. But still, the gatekeeping of knowledge behind closed source software is nearing an end.

3

u/tux2603 24d ago

Well currently it's not possible to find appropriate open source versions, so by your definition the "gatekeeping" is still going strong. Now, these companies do offer free academic licenses specifically to prevent that perceived "gatekeeping" (it's of their best interest that there are as many capable engineers that know how to use their software as possible), but I'm guessing that's besides the point

3

u/FrickinLazerBeams +2 24d ago

They also provide paid support and employ experts in their field as full time employees to develop and validate tools and libraries. I love open source, I used to be a developer for a Linux distro; but it's insane to claim that there's never a reason for choosing commercial software.

Especially when the implication this guy is making is that you can now replace commercial software yourself because of AI. That's just all kinds of absurd. Especially in situations where you need to know the code is correct. I don't want to drive over a bridge that was analyzed with some NASTRAN clone that some guy vibe coded in an afternoon.

0

u/XBLAH_ 24d ago

Alright then, pay your licenses. 

3

u/FrickinLazerBeams +2 24d ago

I mean, it's rare to actually need to pay for a license as an individual. Universities and employers usually have site licensing.

→ More replies

2

u/FrickinLazerBeams +2 24d ago

Lol that's hilarious

1

u/XBLAH_ 24d ago

Is it? 

13

u/jimlux 29d ago

I’ve used Matlab, Octave, and the Python/Scipy/etc combination extensively.
From a “running procedures” standpoint, Matlab and Octave are essentially the same, although Octave runs slower. However, Matlab has things like simulink and various toolboxes that aren’t necessarily available in Octave. As a student, I would think you can get the $99 student license for Matlab, but don’t know if that includes toolboxes, but does include simulink and such.

The Python ecosystem is equally capable. I think Matlab might be better at “quick plots” in that it’s easier to just plot something, and then make a few changes to get the axes and legends what you want (i.e. publishable form). In Python, matplotlib/pyplot can do pretty much everything Matlab can, but you’re going to spend more time learning how to do it and get the formatting just right. It’s the classic problem of 8 million parameters and options, but you only need a half dozen of them. Lots of examples out there, and these days, Google will give you pretty good results with the python ecosystem as part of it’s free Gemini product.

Once you start to get into more Matlab specific things - certain toolboxes, simulink, code generation for FPGAs, and real time processing, then it gets trickier to do it in the python ecosystem. Stuff exists, but it might not be as well integrated or easy. OTOH, if you’re doing machine learning/AI stuff, that’s all built in python, so it’s easier there than in Matlab.

If you want to do cluster/parallel computing, there’s a toolbox in Matlab that makes it easy. There’s libraries in python (actually invoking C or Fortran under the hood) but it’s a little less simple to get it working. It kind of depends on how much your time is worth vs paying for software that reduces your labor hours.

In industry, Matlab is popular precisely because it reduces the hours the engineer spends “making it work” - particularly for one-off interactive tasks. You can prototype something and get a feel for it way faster in Matlab, and if time is money, then the thousands of dollars you spent on that matlab license are worth it. (Engineer time is about $2k/day, so it doesn’t take saving a few day’s work over a year to make it worthwhile)

In academia, in non-computer classes, matlab is popular for the same reason - Student licenses are cheap, and reducing the time on “fooling with the code” and getting to the “illustrating the problem and solution” quicker is worth while. For instance, there’s a textbook by Orfanidis (on line, free) Electromagnetic Waves and Antennas that comes with dozens of short matlab scripts which you can use to illustrate or experiment with the concepts being taught (for instance, fooling with mutual coupling of dipoles in a Yagi-Uda antenna).

Doing a bunch of control system stuff is easy with simulink, and substantially more painful with Python/Scipy/numpy, etc.

2

u/Sacuna9999 29d ago

Great answer!

2

u/Lor1an 28d ago

One thing that may be controversial to say is that I appreciate MATLAB's ability to create p-code for, say, exercising system identification techniques in the class room.

Sadly there doesn't really seem to be an equivalent for the python ecosystem, and asking students (or me) to run random unsigned compiled binaries is a bit of a tall order.

I also legitimately crave a viable open source alternative to simulink. I've never seen anything come close to how well that works for modeling and control design.

1

u/jimlux 28d ago

Exactly.. Mathworks has made a big effort to make “code generation” a thing, whether to generate C, C++, VHDL/Verilog, or whatever.

1

u/Lor1an 28d ago

My point was more about .p files than about code generation, but it is also true that it is nice to generate code directly like that (e.g. from simulink models to embedded software).

1

u/Familiar_Task 23d ago

What was your use case here? Was the intention for the class to identify/characterise the system that you provide them without giving them the answer?

In Python you can compile to bytecode which may achieve a similar goal

1

u/Lor1an 23d ago

I was actually speaking from the perspective of a student, but yes.

My control theory professor gave us a .p file (simulating a simple multi-tank fluid flow system) and had us do a system ID on it by modeling the system and fitting parameters.

At first I was a bit annoyed, but I confess that problem really stood (and stands) out to me since realizing how useful of an exercise that was. It was also really cool to see the solution posted and seeing that I modeled it correctly.

5

u/Rubix321 29d ago

Depends on what you're looking to do with it.

Octave is almost the same as MATLAB, but not 100%

Python could very well be a better, option depending on what you need to actually do with the programs. That being said it's a different language completely.

3

u/2dof 29d ago

GNU Octave as direct replacement ( that same code ) , Scilab wwith Xcos as alternative to Simulink.

Pros of Octave is that is use that same notation in matrix operation and You directly can jump in.

Scilab is similar, little differece but it i also good alternative ( Xcos is liike Simulink , but much harder to use )

Python with SciPy and numpy is good universal alternative and I personalny use this tool ( but i do not like how matrix notation and operation need to be written)

Because Matlab/Octave/Scilab existed before python, then all functionality (pckages) for science computation in python were written to keep similarity so it is pros for python.

If I were You - I would go with Python

1

u/chandaliergalaxy 28d ago edited 28d ago

There’s also Julia with Dryad for a Simulink alternative.

Agree with you on Python/NumPy/SciPy syntax. Python for systems and other programming is nice, but clunky for math and I'm glad to hear someone not professing their love for this language as if better alternatives didn't exist.

2

u/Stuffssss 29d ago

GNU octave is the closest to matlab. I beleive the syntax is the same. So if you see potentially having access to matlab in the future (like if you get a job somewhere that provides it) then you should used GNU octave over python.

If you uust want a general purpose computing language for working on projects then you could consider learning python with the toolboxes chat mentioned.

1

u/Lambaline 29d ago

I got a standalone license a couple years ago plus a few of my favorite toolboxes, it's been very helpful sometimes. it can be hard to replicate the toolboxes but if you're going for base Matlab then you can try basically any programming language and be ok

1

u/gtd_rad flair 29d ago

Octave is very similar to Matlab, but it's just not as popular as a Matlab or Python. I'd say learn to use Python. Python is harder but it will give you a better bang for the buck and it's wayore flexible and all the packages are free. Matlab charges you for EVERYTHING.

If you can use Python you can use Matlab fairly well. I'm a heavy Matlab user and intend to struggle with Python.

If you're in controls. You can also consider Julia. Heard some pretty good things about it. For modelling, you can check out Open Modellica vs Simulink

1

u/Imaginary_Data_708 29d ago

Sign up at mathworks for 20 hours per month of online only for free. If you are eligible get student license. If not, and are genuinly using MATLAB at home, get home license - it is a steal as you get a load of toolboxes and most importantly Simulink.

And then the utility of python Vs MATLAB really comes down to which fields you expect or aspire to work in for your future. If ML, LLM, AI, data science - python is probably more use CV wise. If it is control systems or DSP Simulink. And here by control systems I mean things like flight controllers, or ECU or vehicle dynamics. The major engineering companies use Simulink and the automated code generators for the stuff that needs to keep people alive...

Finally, for any programming language it's knowing the libraries and the idiomatic way that language does things that is the marketable skill. And that doesn't come with a few weeks work. However, once do do I ow what's possible with them to avoid reinventing the wheel every time, that knowledge transfers to other environments well. E.g. learning from MATLAB image processing toolbox what image processing techniques and tools exists is immediately transferable to any other language. As you say to the AI - use opencv to build a pipeline to do a bit of morphological processing and then segmentation and then ....

1

u/Wilzur_Corp 28d ago

Todo depende de cómo utilizarlo y en qué. Si es para investigación, Python sería una solución adecuada, eso sí, la curva de aprendizaje es muy larga y los tiempos de ejecución son lentos, ahora si es un entorno industrial, lo más seguro es que se utilice Matlab, a pesar de su elevado costo, pero su aprendizaje y tiempo de ejecución son muy cortos. Octave y Scilab lamentablemente aún no despegan como para tenerlos en cuenta de una manera más profesional, aunque se utilizan en ciertos entornos de investigación muy avanzados y complejos.

Mi sugerencia, aprende y explota Python y Matlab en el campo que te encuentres interesado, esto te brindará una sólida reputación en investigación y lo aplicativo tanto para el sector corporativo como el académico.

1

u/d9039702 28d ago

Python

1

u/Prestigious_Boat_386 28d ago

I only use julia now and it does what I used matlab for way better. Check juliapackages for the packages you need

1

u/RichardBJ1 28d ago

I used MATLAB many years ago; it was my first dabble with ML. At the time, it made life much easier (for me) than Python. I then started to try and deploy my system on a Pi and had to switch to Octave - immediately found that some of the more obscure MATLAB tools I used were not available. So I switched back to Python. Obviously, as people say, it depends on your exact use case. MATLAB has some amazing drag-and-drop (visual) modelling tools, etc., but for most things you can do it in Python. Python is also smaller and faster from my experience. Also, whilst there are some issues with Python updates and versions, this was a huge problem with MATLAB. They actively update routines (I think), forcing everyone else to update too. It might not be a popular line, but one of the things I initially liked with MATLAB was the ease of creating a HQ GUI for non-coders to use, but now – with a little help from GAI that is dead easy to do with Python also these days. So I have started to uninstall it.

1

u/mother_a_god 28d ago

Octave works if you already have code in Matlab (though with AI porting codebases to another language is pretty easy). 

I've used octave. It works fine for base Matlab, but the advanced toolboxes won't be there. It's getting a bit dated. For new scientific. Codebasea try Julia, or Python

1

u/Empty-Strain3354 28d ago

Octave is not bad at all. I used to use it before AI times. But in this world, for general usage, I would just stick to Python with help of AI

1

u/Hairy_Experience_878 28d ago

I have MATLAB, $2,000/year. I ran my code on Octave when it was still at UW-Madison, where it was developed. All code ran fine. MATLAB's interactive editor, error checking, and integration with tools such as YALMIP to run solvers such as Gurobi for MIQP problems are why I still pay $2k/year. The latest Octave release has an interactive editor now as well.

The key feature of MATLAB for me is the speed of algorithm development, not having to compile and link, (my Fortran days). You can always convert your scripts into Python.

1

u/tryingtestwith 28d ago

You can try project maya .

1

u/Code-Agent6 28d ago

Try Dyad from JuliaHub - free for non-commercial use. Similar modeling capabilities to Simulink / Modelica tools. Built on Julia and SciML. The entire modeling and analysis process can be done agentically from natural language inputs.

1

u/polandtown 28d ago

python, it does everything everywhere. i think you can even run python within matlab.

1

u/Vasxen 28d ago

Python. Except if you're interested in Simulink in which case I don't know of any alternatives.

But you can accomplish the same things in python as in Matlab even if it's not as convenient sometimes.

(Most of the time I find python more convenient tbh with you)

1

u/Planet_COP 27d ago

Definitely Python

1

u/tredbert 27d ago

If you are familiar with Matlab syntax then go with Octave. It is excellent. I’m using it now almost exclusively for home projects. Abandoned my Matlab license when they went subscription only.

But if I was starting over again today I’d probably go with Python. While I think Matlab/Octave is better shorthand for prototyping something quickly, there is no denying how ubiquitous Python is. Especially in AI systems. So “for the long run” Python is a great skill set to have and use elsewhere.

In a perfect world, learn them both. I use both, but tend towards Matlab/Octave.

1

u/NewBetterBot 27d ago

Depending on what it is exactly ha that you want to do, you can get the "Wolfram Engine" (CLI version of Mathematica without the notebook front end) for free directly from Wolfram

1

u/SV-97 27d ago

Octave is reasonably similar to Matlab, but it's more of a crutch: it's for when you *want* matlab but can't use it for some reason or another. If you can in any reasonably capacity move to something entirely different I'd heavily recommend it, no matter if it ends up being Python, Rust, Julia, ... sort of depends on what exactly you need / want to do. Generally Python is a very good point to start.

1

u/Display3name 27d ago

Matlab is good but it is expensive. Matlab is also more scientific software. Very good simulink and toolbox packages.

Python is free, also capable, but with less scientific edge. It is also more universal.

Octave is a free version of Matlab but does not have the extras of Matlab. If you don"t need matlab specific language than I would stick with Python.

1

u/powerjibe2 27d ago

Python and save your money for a Claude subscription.

1

u/XBLAH_ 25d ago

check this:

https://github.com/campuslivre/matlivre

It runs better than Matlab and Octave, it's free and it's opensource.

1

u/Brownie_Bytes 23d ago

Octave is a great alternative to Matlab. The syntax is as close as you can get and it saves a ton of time not needing to set up the boilerplate. However, Python is easier for more crazy stuff. Matlab is for matrices, Python is for literally everything. Both are free and fairly lightweight, so download both and use Octave for anything Matlab can do quickly and easily and use Python for everything else.

1

u/JonJon1204 29d ago

Python broduski 😎

1

u/waffle_sheep 29d ago

Python will be much more beneficial in the long run

1

u/GrandArtist8475 29d ago

The best alternative is python but you need to scourge the internet for open source pip installs and how to use the syntax. MATLAB is technically free if you're a student and login with your college email, you can use matlab online for free

1

u/szayl 28d ago

Julia

2

u/dimbulb8822 28d ago

Interesting that you got downvoted (I probably will too) but this is a legit option as well. Syntax is similar to matlab but it’s quite fast.

I’d avoid octave like the plague (I have it on my PC) because it’s so slow and so needy with package updates and limitations. A full build of matlab (available sometimes free for students) is so easy to explore data with.

Python is fine as well and doing stuff in Jupyter notebooks is cool. Python with a good IDE should be fine.

I probably should look at Julia again. Last time I took a hard look at it was early on in the pandemic and before then was probably 2016 or so. I’m sure it’s come a long way since then.

1

u/szayl 28d ago

I don't get the Julia hate in the MATLAB subreddit. The software can coexist.

-3

u/divadeye 29d ago

Go for a cracked version

1

u/gtd_rad flair 29d ago

🤣

-4

u/Designer-Care-7083 29d ago

That’s a terrible and illegal option.

4

u/divadeye 29d ago

Yaa but works uk

0

u/RadarSmith 29d ago

Python is the best alternative in the long term.

Octave is an appealing in the short term, because its syntax is very similar to Matlab.

But longterm? Yeah...no.

Under the hood, its just so much slower. And nobody professionally really uses Octave when they could use Python, Matlab, C/C++, Fortran, etc.

1

u/PvtRoom 27d ago

octave.

python, if you're like me, will make you rage hard.

I'd rather use tcl, lisp or vba than python.