185 points · by lelf · 7y ago · 77 comments
Octave is a great tool, and it addresses a very real need - breaking MATLAB's stranglehold on academic computing.
Every programming course I took as an EE undergrad (other than Intro to Programming) was in MATLAB. 14 years later, and it's still the standard tool in my alma mater's EE department. Having a FOSS equivalent is huge.
So raise a glass to the Octave dev team. They work hard to provide a FOSS tool that can run MATLAB code, which gives you the software you need for self-guided learning from university materials. Or for your all your computational needs.
And Octave is a great tool even if you don't need MATLAB compatibility. Try it out the next time you've got some numerical computing to do.
Not an Octave dev, just a fan of the project.
Unfortunately it's still omnipresent. Even in very basic courses, where the abilities of Octave would be enough by a large margin. I don't think it changes until the next generation comes.
The next generation of professors.
https://octave.org/doc/interpreter/Acknowledgements.html#Ack...
Why should anyone use Octave over Matlab?
- Licensing cost.
- Freedom.
Why should anyone learn Octave instead of Python?
- It's a bit easier to get started for scientists who are not programmers.
- If you mostly do vector/matrix math, the language is nice.
- Otherwise I don't know any good point.
All in all I like a free alternative to Matlab but have the feeling that most people are just better served by joining the much bigger Python ecosystem. (Or maybe R/Julia/Rust which I don't know so much about in this context.)
And that was before numerical python existed. Now, MATLAB compatibility is about the only reason to use Octave. But a better idea is to get out of the MATLABiverse altogether.
As for reasons to use Matlab:
Matlab comes with XYZ toolkit: This isactually a good reason if you know that XYZ toolkit is your core business. In general though, the Python ecosystem is far bigger that Matlab's one.
Easy for scientist: Trap. Every MATLAB using scientist I know ends up with a code base that is too complex (~1000-5000 lines of code) for the language, but is perfect for Python. (Exactly like how programmers start projects with Python that then grow too big for that language).
Admittedly falling into the trap once might be cheaper than learning Python, assuming you never need to program anything again in your life.
Vector/matrix math: Numpy has all the same vector/matrix stuff including a class which does matrix-multiply under that '* ' operator like MATLAB. But that tMatlabhat operator is a trap: '.* ' is far more common in MATLAB code and accidentally using '* ' is a common bug. This is effortlessly avoided in Numpy standard classes.
Exactly! And I feel R has a similar problem.
Coming from physics myself,I understand that beautiful notation can make things much easier and can be often the way to find great solutions, but proper organization will most often be sufficient.
Let professional language do professional things, and the advantages of various languages complement each other.
Personally, I do a lot of numerical calculus and prefer octave than numpy, just because the language is less verbose and more comfortable to use. I have converted many times ugly python+numpy code into beautiful octave. If your main and only goal is to perform matrix computations, then octave is excellent. I have never used nor needed the commercial matlab.
The python numerical stack has a rather absurd feeling in my eyes.
The related product Simulink is not uncommon in larger engineering firms also.
Back in the day, the community around MatLab was quite large, but likely has declined in size in the last few years with the rise of Python in this area.
This has definitely been changing for a while. All engineering studies of my old university except for computer science and mathematics have switched from Java+Matlab to Python over the last years. I've already seen this have an effect on workplaces, where new students prefer to use Python and are generally allowed to.
I'd love to witness this. I used Matlab heavily as an engineering student, and now mostly work in Python. Python is definitely better for complex programming, but where the program is simple and the math is hard, Matlab seems like a great tool.
I'm curious what tools/libraries python users now use that brings Python up to the usability of matlab?
As for Octave, I've used it a couple times in the past but found the environment underwhelming (especially so when creating plots). I also tend to run into various compatibility problems when running scripts developed in Matlab.
It is the same for me with R vs. the Python equivalents.
So your strategy of designing in Matlab and porting later (if necessary) makes a lot of sense.
Octave, on the other hand is IMO really only of interest if you somehow need some degree of compatibility with the Matlab ecosystem or want to teach non-programmers how to do some basic numerical linear algebra stuff. Otherwise, if you want something free, just stick with python.
It’s interactive, really well suited for matrix operations, has all the packages you’d expect for analysis, optimisation, etc.
Like others have said, once you nail it in Octave, move it to C++ for production and then wrap it in R, Python, etc to your hearts content.
vec3f x = {1,2,3};
fmt::print("x = {}\n", x);
// output:
// x = [1; 2; 3]I used it successfully in my EE degree in 2010 for all my Digital Signal Processing assignments, instead of MATLAB.
The docs don’t mention this but can it create candlestick charts or can I extend using C++?
Also, extending with C++ is easy, see https://octave.org/doc/v4.0.1/Getting-Started-with-Oct_002dF...
I'd say if you are someone who's even remotely mathematically minded, learning to use Mathematica is an extremely useful experience. As an example that recently happened to me, while doing front end work I needed to construct certain geometric figures as an SVG polygon; I used Mathematica's built in graphics primitives combined with its plotting capabilities to find the polygon in no time. Even though the end result is a piece of JavaScript, Mathematica gives me a way to prototype the whole thing in an environment that's "batteries included" and well-polished.
Mathematica is way more targeted to the "general public" though. It's fairly obvious that MATLAB started its life as fronted to FORTRAN.
Actually, it's way more targeted to mathematicians. The level of symbolic computation it can do is way ahead of any symbolic toolbox you'll find. When I was in grad school, I used NumPy and my group mate used Mathematica. One day I was looking up identities in Gradshteyn and Ryzhik (a bible for identities), and he asked why I bother as Mathematica had it all. He challenged me to find any identity that Mathematica couldn't handle. I thought this would be easy as G&R has more stuff than any other identity handbook out there, but I lost the challenge.
I second that and there are quite a number of scientists which use MATLAB and FORTRAN side by side.
I would extend this statement: MATLAB feels like a REPL to FORTRAN while Mathematica like a REPL/library to/for LISP.
[0]: http://maxima.sourceforge.net/ [1]: https://wxmaxima-developers.github.io/wxmaxima/
A large OSS player is nowadays also SageMath https://www.sagemath.org/ which is a kind-of-meta CAS which can actually proxy evaluations to Mathematica, Maxima, Octave and many others, in a more or less uniform pythonic notation.
Probably needless to say, when it comes to evaluation power (for instance for integral solving), Mathematica is unrivalled from OSS projects. However, in certain fields (such as number theory for SageMath or the overall web notebook infrastructure by the IPython and Jupyter projects), the concurrency is catching up or may already have overtaken Wolfram's products.
So, one can say it is as closed to Mathematica as MATLAB is.
Languages like Matlab, Stata, SAS, or R don't seem to be designed for professional developers. They tend to break all the assumptions that every other languages have (like array indices beginning with 0). I also feel this way about Pandas, it seems like it was designed by a data scientist and not a developer.
Because the people using these particular languages don't care about elegance (they usually just want the graphs or papers or whatever) and that no one is writing commercial systems that need to be maintained, there's no real incentive for them to design a language that makes any sense.
Making things ad-hoc and less axiomatic does have its benefits however, these kinds of languages can be surprisingly expressive and powerful.