22

I recently joined the folks using Linux. As a result, I'm trying to replace as much of the propriety applications as I can, with free — and if possible open-source — alternatives.

Since I need a decent tool for my math experiments and I used to use MATLAB R2013b on my former Windows install, I'm eager to learn about free — preferably open-source — alternatives to Matlab that will run on Linux (Ubuntu).

Are there any free alternatives to Matlab that run on Linux? What's most important to me, is that the alternative to Matlab should be a close-fit when it comes to syntax compatibility… so that most programs can be easily ported (or — if possible — imported). Also, I'm pretty sure no alternative will have the complete functionality set Matlab provides, so it would also be important for me to know what differences in functionality I have to expect when using the alternative(s) you suggest. Meaning: is there anything the free alternative(s) can do MATLAB R2013b can not do, and vice-versa?

13
  • 3
    Matlab has a lot of features. Which features do you use? Have you tried Scilab, which strives to be a free alternative to Matlab? Commented Feb 5, 2014 at 9:56
  • 2
    @e-sushi It makes no sense that there are open-source applications that replace propriety applications. You should include a list of specifications of what you want.
    – Bernhard
    Commented Feb 7, 2014 at 12:17
  • 4
    @Bernhard: "as many as possible" seems like a very clear requirement. Are there really so many Matlab alternatives for Linux that cover most of its features, that choosing one or two with closest compatibility is difficult? Can you name ten such programs?
    – SF.
    Commented Feb 7, 2014 at 12:23
  • 2
    @Bernhard: If you haven't noticed by far, this question already has an approved answer. Something that satisfied the asker. Considering someone, using the given guidelines, was capable of giving a satisfactory answer is a factual proof the question was clear enough and doesn't require further clarifications. Do you believe you can give a solution better than Olli if e-sushi answers your questions? General compatibility across the whole package is just as valid metric of desirability of a package as any other, regardless of what you think.
    – SF.
    Commented Feb 7, 2014 at 14:50
  • 2
    @Bernhard: This is your opinion. In my opinion this question is pretty good, and "most similar to given" is a perfectly clear and very much acceptable guideline. I really don't understand your hate. (and whether he uses all features or not is moot. For example, I'm a writer. I tend to ask questions about things I never use nor intend to use - characters in my stories do. If I was to avoid trademark issues with my book and still have my character use a real non-abstract software similar to Matlab, and running on Linux, I'd ask the same question.)
    – SF.
    Commented Feb 7, 2014 at 15:09

5 Answers 5

19

There's no single replacement for Matlab in Linux. Matlab is really huge software package, including quite large library ecosystem.

Octave is one free alternative for Matlab. It's missing quite a few features, but all basics are there. I have used both, but it's rather hard to give good evaluation based on my own feelings. This page lists some minor differences, but mainly cases where Octave is better than Matlab. Probably the biggest issue is that some functions act differently, for example, product of booleans and loading empty files. This is important, as it makes porting your own scripts harder, as unexpected things happen.

My own feelings are that

  • Matlab is way more mature than Octave (shouldn't be a surprise)
  • Matlab is faster (I don't have empirical data on this, it's just a feeling)
  • Matlab UI is remarkably better
  • Library support and available example code around the web for Matlab are higher quality than for Octave.

That being said, Octave is free, and Matlab costs way more than average consumer can afford to pay.


Sagemath is another alternative, but it's closer to Mathematica in functionality.

For more do-it-yourself solutions, take a look at R, Scilab and Python. You won't get integrated, all-in-one package with these, and learning curve is rather steep.

3
  • -1: I believe the guidelines for SR is "one product per answer". Otherwise the votes do not reflect belief in individual products, which is the real point here. I will apply a +1 vote to an pure Octave answer, but have no opinion about SageMath.
    – Ira Baxter
    Commented Feb 5, 2014 at 6:53
  • 5
    @IraBaxter Can you point me to this guideline?
    – Olli
    Commented Feb 5, 2014 at 7:55
  • 3
    @IraBaxter That's being discussed, but there's no consensus yet.
    – Tim Post
    Commented Feb 5, 2014 at 11:07
16

Octave

as Olli said Ocatave is a matlab alternative:

Notable Features (shared with matlab):

  • Syntax near identical. it will consume almost all m-files without changes. the mfile is also its default format. The syntax is so identical that my university's matlab course uses octave in the autograder, even though the unit is taught entirely in matlab and only mentions octave once in passing.

  • High quality BLAS Library integration (Normally I beleive it is integrated with OpenBlas but this can depend on your system, it may be Atlas). Because of the BLAS, like matlab it is much more efficient to used vector techniques (rather than for loops) - so good matlab code is still good octave code.

  • Automatic multithreading for performance: if you write some complex code in octave or matlab and open up a tool to see your CPU load, it will load up all of your cores. This parrellisation means things should run faster.
  • 3D Plots with mouse interaction: If you create a 3D plot, the window that opens supports mouse interaction to zoom, pan and rotate.

There are also a few added features, but I've never found them noteworthy enough to remember them.

Notable Features missing:

  • Libraries: There is no simulink, and various other libraries such as the Signal Processing Toolbox, don't exist. But there are some alternatives like the signal package
  • GUI Workspace: the octave work enviroment is a commandline shell. It is functional and uses something like GNU readline. When you plot a graph that opens in a new window with full graphics. (of the graph). But there is no Plot editor, no file exporer on the side, no variable explorer etc. Just a shell.
1
  • 1
    Correction: I have recently installed Octave 4.2.1 building from source. If you have the proper dependencies in place, Octave comes with a neat GUI. So Octave is not solely a shell program. Commented Mar 12, 2017 at 8:18
9

I would recommend Scilab as I have used it and found it to be a decent open-source alternate for MATLAB. It doesn't have the robustness and polish of a professional package, but since it's based on the MATLAB language, what you'll learn can be transferred later on if your needs change, or you find yourself working in an environment where MATLAB is the default.

Quoting Richie Cotton on Stack Overflow:

Scilab is to MATLAB as OpenOffice is to MS Office. That is to say, it's a not-quite-a-clone, and it's not as polished. You do get most of the functionality of MATLAB, and the price is much more agreeable.

3
  • [+1] Anything you can add about syntax compatibility to Matlab (to know if it's easy port existing stuff to Scilab)?
    – e-sushi
    Commented Feb 5, 2014 at 11:14
  • 2
    Scilab has an inbuilt m-file translator, which makes it easy to port your code to MATLAB. Plus, it's cross-platform, i.e. it works with Windows/Linux/MacOS. Well, since I've only used SCILAB, I won't be able to tell it's advantages/disadvantages over others, but yeah, I found it to be pretty good.
    – Ranveer
    Commented Feb 5, 2014 at 11:19
  • Also note that Scilab has been around for a while and that it is sponsored by the French government. Commented Dec 16, 2016 at 1:26
8

Take a look at Julia: http://julialang.org/

Julia is designed for numerical scientific work, including interactive work. It has a good quality notebook interface available like Mathematica and Sage. It has best-in-class performance, check out the benchmarks on the front page. It can call Python, which opens up lots of useful libraries for it.

Julia has been specifically designed to make the transition easy for MATLAB users. The basic syntax is similar. However, its programming language is more modern and advanced than MATLAB's (e.g. it supports metaprogramming).

Julia is a relatively new system, so it is not as complete as others (R, Octave), but it has a growing community and it shows a lot of promise.

1
  • 1
    (as you say) A notable feature of Julia that is particular good compared to say numpy, is that the syntax for numeric operations is almost identical to Matlabs. To the extent that when porting numerical algorithms, copy and paste then fixing the exceptions is viable. Commented Aug 20, 2015 at 9:38
6

If you don't need exact compatibility with Matlab, Freemat is an option.

enter image description here

http://freemat.sourceforge.net/

It can be quite fast, as it uses LLVM as a JIT compiler.

http://freemat-blog.blogspot.com/2008/02/why-jit-how-to-jit.html

Freemat has had an integrated GUI for longer than Octave, although Octave's GUI has been getting better.

The main drawback is that it is not as actively developed as Octave is; the last release was in 2013.

https://www.openhub.net/p/_compare?project_0=FreeMat&project_1=GNU+Octave

1
  • 1
    I used Freemat in 2010 at a startup company, it met our needs. Commented Dec 16, 2016 at 1:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.