Octave: An Alternative to the High Cost of Matlab
math-blog.com
math-blog.com
- the plotting using gnuplot is not as flexible as Matlab's plotting, although it is getting there
- in an attempt to steer clear of copyright issues (I presume) many (most? all?) of the mathematical functions have been written from scratch, and while they typically use the same references as Matlab functions, Octave functions may give slightly different answers than their Matlab counterparts. If you need 100% compatablity with Matlab, make sure to do plenty of testing first.
Oh, and for anyone who would like to try out vector computation on a GPU (eg. CUDA), you should check out the Theano project (a symbolic math library that can offload execution to the GPU): http://deeplearning.net/software/theano/introduction.html
All in all, octave is quickly becoming a very viable alternative to Matlab.
<obligatory-GPL-comprehension-nitpicking>
GPL is never a problem for users. The GPL is a problem for rogue developers who might want to extend (or just rename, or not even that) Octave, close off the source code and then themselves start posing a (licensing) problem for users of the extended Octave version. But that is OK, since the GPL was designed to pose a problem for code closers and problem makers in the first place. Thanks for reading.
</obligatory-GPL-comprehension-nitpicking>
For example a Sony or Nintendo SDK would have the gcc compilers, linkers, bintools, etc, and they would distribute the source... Yet nothing stops them from writing pre-linker, post-linker, pre-compiler, post-compiler steps that would be required by the developer to get called (or get called automatically by a tool).
In such case you mix well GNU (GPL) with closed commercial software, and distribute the end product just fine.
But yeah, external calls seem to be the safest bet right now, even if it isn't always the most optimal solution.
(e.g. you can often use GPL'd components by writing a server wrapper around them and communicating from your non-GPL code via network communications for example, an arbitrary, and silly distinction from just linking in the components and using message passing, but hey...apparently that's what freedom (as in free, not as in beer) is all about).
(But even if it does, nothing stops you from splitting the package in two, and providing two packages, rather than one).
The situation with combining interpreter code that doesn't access compiled libraries (e.g. pure octave M-files, or python code) isn't really clear to me. The FSF's opinion has been that a script that uses GPL'd interpreter code is subject to the terms of the GPL. I personally accept that interpretation out of deference to the FSF, but I've never understood specifically how that conclusion arises from the text of the GPL.
I do all my DSP algorithm research in Octave, because the price of MATLAB is just too high. I think I'm looking at somewhere on the order of $4k for a single license to obtain the signal processing stuff that I need in addition to the core license.
Would I prefer to have more graphing options, and some assurance that researchers' MATLAB code will work out of the box? Of course!
That said, Octave gets me really close for a fraction of the price. Also, I can peek inside the Octave source and get an idea of how the underlying routines work.
Python/Numpy works pretty well for this sort of thing too though, and the graphing features seem a little more sophisticated.
Furthermore, I've built an entire Objective-C math framework (https://bitbucket.org/liscio/smugmath) that operates very similarly to MATLAB (i.e. vector-oriented) and allows me to easily translate DSP algorithms found in research papers over to shipping products (http://capoapp.com, http://fuzzmeasure.com).
And yeah, since Matlab is pretty much the standard it's a big plus to be able to use code from papers etc directly in Octave. Translating to Numpy is usually straightforward but it's definitely an extra step.
Numpy becomes very nice when you need to do some more general-purpose coding along with your numerical stuff though.
Once you get used to "cell arrays" and "structs" and "struct arrays", you can do most anything in Octave that you can in Python, but the weirdness of those syntaxes is quite off putting for a lot of coders.
WRT to packages/ toolboxes, Octave and Octave Forge have not quite reached maturity, and there is ongoing debate about how to do that.
WRT to Simulink,... that is such a specialized graphical thing, I don't think it is coming down the pike any time soon. Somebody else mentioned an alternative...
Otherwise I'd just stick to scipy, there are so much more python libraries out there, plus you get to use matplotlib!
(Not trolling, just curious. I've never used Octave, but I'm curious whether I should try.)
As someone who switched from Matlab (student license) to Scipy, I've come to the conclusion that Octave is a solution to the wrong problem. While non-student Matlab licenses are expensive, Matlab itself is also a crufty language that, once you exceed its core domain of "problems that only require (or can easily be represented as) N-dimensional arrays", quickly tends to spiral out of control. I've had this happen to me. Python, on the other hand, is a language that is already quite elegant, and the Scipy packages can allow for almost-verbatim translation of some Matlab code, but without losing a lot of other power and flexibility.
You're certainly right that's it's not really a fair fight between the languages. WRT Octave, though, anyone for whom a MATLAB license is too expensive probably doesn't have the mountain of legacy code that would be required for me to justify staying with a technically and aesthetically less pleasant language.
It is a bit of a pity to see the effort split between two huge projects with roughly the same goal. Anyone has any ideas why it is so? or is it like a vim vs emacs(i.e. quasi religious) issue?
Unlike Octave, Scilab's goal is not compatibility with Matlab. Unmodified Matlab code will not run in Scilab. One of the goals of octave is to run Matlab-compatible code. Scilab has a comparatively limited syntax relative to Matlab and Octave. Octave's syntax is more expressive than Matlab's but currently lacks the new classdef OOP (Octave does have @class OOP) . The last time I checked Scilab didn't seem to have any OOP.
-The specific packages offered by Matlab (like the mapping toolbox, simulink, parallel computing, etc..).
-The training support offered to companies (I am not a huge fan of this, but I meet an awful lot of people who are).
-The existing user base.
-Finally, $10K (Matlab + a few packages) annually is not that much if it enhances productivity.
Even for students, I wonder if they would be better served getting used to Matlab because that is what they will end up using in industry.
R's graphing facilities are superb though, and easily outdistance Octave's. So if you want to build complex visualizations that might trump other concerns.
Numpy/Scipy can do most of what R and Octave can do but their syntax isn't optimal, since they're built on a general-purpose language.
Octave/ matlab is more graceful at handling complex matrix manipulations than R, but poor at categorical data or data management.
If you want to write your own algorithms, use Octave. If you want access to libraries, use R.
(I personally find R ugly and matlab pretty.)
And ... so your student's plots look slightly different? Like what? ticks on the inside / outside, or??? That that's a deal breaker surprises me.
Personally, I use sci/numpy for all of my statistics/numerical analysis needs.
Maxima which is a direct decedent( I think they even share code now) of Macsyma one of the first symbolic math packages developed at MIT. Wolfram was inspired by it when he created Mathematica. In fact I think it was because he despised macsyma (cause it was in lisp and not C I believe, there are some mailing list post describing the events) that he decided to create Mathematica. So the enemy of your enemy is your friend ;p
It's not part of Octave, but a version of it is integrated with Scilab, another sort-of Matlab alternative: http://www.scilab.org/