18 ms·
Last time I tried Octave it was several times slower than Matlab. Why use Octave instead of R, Python, or Julia? There is nothing Octave/Matlab can do that they
by BrandonS113 4y ago
Last time I tried Octave it was several times slower than Matlab. Why use Octave instead of R, Python, or Julia? There is nothing Octave/Matlab can do that they can't. And anybody needing Matlab surely can afford to pay the licence fee?
- thatsadude 4y agoWell, when you have thousands of Matlab functions you wrote over a decade, you would rather use Octave instead of rewriting them in Python. I also suppose that Octave is slower than Matlab because OpenBLAS is inferior to MKL.
- KeplerBoy 4y agoCan't you just link Octave against mkl?
- danaos 4y agoOn top of that Octave is not 100% MATLAB compatible, especially if are into more complex projects with toolboxes. I wasted tons of time try to do a college assignment in Octave before turning to MATLAB.
- wakeupcall 4y agoMy experience: you get code from a fellow researcher using matlab, and nobody in your institute is using matlab. Getting approval for licenses is much harder than you'd think. The money is the smallest part. In the end you just want to run the code once or twice, most of the time octave is going to be enough with zero or minimal changes. Cannot count the amount of times octave saved the day.
- dagw 4y agoI've tried this many times in my career and it unfortunately almost never works out of the box for me for anything but the most trivial examples. Either they're using some library or toolbox that Octave doesn't have, or they've used it in a way that isn't 100% compatible with Octave.
- wakeupcall 4y agoI can believe this, the status of the various libraries/toolboxes is not all made equal so YMMV depending on the field. We had a few cases where this was the case involving the signal processing toolbox for example and couldn't reproduce the same results. In such cases we just refused to participate in the consortium. In my old field we were mostly using R. If there's no active use of matlab, it doesn't make any sense to license it for a single collaboration. By the time you need it again, the license would be expired. And this completely ignores the "how do you want to run it", which for us involved a linux-only cluster. It's literally trashing money and time. Commercially-licensed software is a true pain for research and collaboration, it doesn't matter if it's any good or not.
- 7thaccount 4y agoCommercial software is indeed a pain unless your entire organization uses it. If you're the one person in your organization that needs commercial software "X" it can be very annoying. First of all it's a major pain for the purchasing team, then your IT folks or yourself have to get it to run and there seems to always be some library or DLL missing or something.
- throwawaysalome 4y agoHad to reread five times before realizing "fellow researcher" was not "in your institute." Commercially-licensed software is a true pain I'm sorry the fruits of our labor don't come free. Some of us enjoy resort vacations.
- olddustytrail 4y agoMissing the point by a country mile. No-one complains about AWS licencing because it's easy: create an account and pay for what you use. Most commercial software is a pain because you have to keep track of licenses. Oh, and working with Open Source software means I get paid approximately double what an equivalent Microsoft specialist does. Learning Linux has been the biggest payoff of my career.
- throwawaysalome 4y agoI didn't. One-for-one products like AWS instances lend themselves to less obtrusive enforcement. One-for-many products like desktop software require pain-in-the-ass key management. You're an IT guy for a [insert commodity here] manufacturer. Nothing wrong with that. When the IT itself is what's being sold, you have to protect your product.
- olddustytrail 4y agoHeh, I am indeed an IT guy. I'm an SRE who spends his time fixing screwups by devs when I'm not teaching them about systems. It's a big world out there kid.
- wakeupcall 4y agoWhen tied to academic research this has bigger implications. Reproducibility is difficult or impossible to assess when there's no source, and it also requires higher barriers to entry (= money). The output of that research will also be tied the commercial license: academics can often get better offers, but you as a user are going to be outpriced. I'm biased for sure, but I'm a deep believer in open research. The output of what I do/did should be free for everyone. R being fully open and free is a big part in what it made it so popular in research.
- dfan 4y agoI use Octave to run other people's MATLAB code.
- electroly 4y agoWe were interested in using a library that was originally written in MATLAB and had also been ported to Python. First thought was obviously to use the Python one, but it was unbelievably, unusably slow. I fired up Octave (have never used it before) and got the MATLAB equivalent working, and it was blazing fast. I'm not a MATLAB programmer and will not learn it; I just need to call this one library.
- IshKebab 4y agoYeah I can't really see a reason to use Octave. The Matlab language is mediocre at best. People use Matlab because it has a great IDE, great plotting support and rock solid toolboxes for just about everything. Yes Octave really only duplicates the language. The Octave IDE is okish, but the plotting support is really far worse than Matlab. Honestly no open source plotting tool I've found (and I've looked a lot) comes close to Matlab which is why I eventually ended up just paying £125 for it, which I think is a very reasonable price considering it is a perpetual license and very niche software. I wish there was some CAD software that had such a reasonably priced hobby use option, but SOLIDWORKS is $99 per year, Alibre has a cheapish option but they slightly annoyingly shift a lot of features into the £1000+ versions. Probably the best option at the moment tbf (other than piracy).
- tylermw 4y agoR’s data visualization capabilities are heads and shoulders above Matlab’s, and it’s free and open source.
- jhbadger 4y agoYes, once you understand the idea of a "grammar of graphics", ggplot is really the best and most flexible plotting system available. There's a reason that people have tried to clone it (with varying degrees of success) as libraries for python and Julia.
- dagw 4y agoFor what it's worth there is a "grammar of graphics" library for Matlab as well, called gramm
- 7thaccount 4y agoCan you zoom in and out on the R plots? I've used ggplot2 and it didn't seem heads and shoulders above any of the other major tools (Matplotlib and the other Python plotting libraries or Matlab) and was way behind what you can do with .NET.
- 4y ago
- sundarurfriend 4y agoFor small projects, Octave is easier to get started with because Octave/Matlab functions tend to be designed and documented more pragmatically. You can look up a function and start using it right away. In Python and Julia, things tend to be documented more "bottom-up". Which is good for large projects, but tends to get in the way when you're just trying to get a small script to check one result or get one plot. (I don't have as much experience with R, so can't say which direction their docs lean towards.)
- bee_rider 4y agoIt depends on the function. For basic stuff, Matlab uses MKL. MKL is available no-cost. You could use LD_PRELOAD or LD_LIBRARY_PATH to get Octave to link MKL (or I’m sure you could compile the whole thing for MKL, but LD_PRELOAD let me use the disto version and I’m lazy). You also may have to tell MKL to use GNU threads. I’ve done it, got decent speed ups with a 6 core AVX2 system, so I guess something more recent could be even better.
- bilqis 4y agoBecause a lot of legacy stuff is written in Matlab. And Octave is not so much slower than Matlab. matlab’s killing features are all those libraries for everything. And I for example don’t like using matlab - it’s not free (as in freedom), it’s very bulky, GUI is slow and heavy, there’s no way to use it as a console app in linux afaik.
- jabl 4y agoIIRC you can (or at least could 10+ years ago) start it without the GUI with "matlab -nojvm".
- komadori 4y agoI used to do that too back when I used MATLAB professionally (also circa a decade ago), but I found with each successive release it worked less and less reliably as use of Java spread through MATLAB's internals.
- Serow225 4y agoYou can run it headless but with JVM, that’s pretty much the actual usable equivalent now.
- dagw 4y agoGUI is slow and heavy, there’s no way to use it as a console app in linux afaik You absolutely can. Many of the Matlab users I know never touch the GUI/IDE. They'll just code in Emacs and run their code from the terminal.
- Serow225 4y agoI worked at the company that makes MATLAB, and the majority of engineers there ran it that way lol.
- newswasboring 4y ago
- syntaxfree 4y agoIt’s a crutch. I was first burned by Python back when 2/7 == 0 and avoided numpy etc for years.
- donkeybeer 4y agoI prefer that behavior. Integers should behave like integers, if you want the floating point division you should write 2.0/7 . Of course now that we have distinct / and // its less of a problem but then it becomes a problem of which behavior do you expect more often, integer or float.
- alerighi 4y agoThe difference (as I see it) is that Matlab/Octave are more easier to use for a person that doesn't know a programming language, such as a math student. While to a programmer Matlab language doesn't make sense (array starting from 1, syntax, a multitude of functions in the global namespace, etc) to a mathematician it does since it more resembles the language of a graphical calculator (that was what Matlab started with). It's true that Python with the use of Jupyter notebooks is getting closer to be a simple to use tool, but you still need to know some programming to use it.
- bee_rider 4y agoTossing everything into the global namespace also makes the REPL experience a little more enjoyable. IMO Octave really shines as a REPL you can write short scripts and functions for.
- rightbyte 4y agoThis so much. Running scripts in Octave and being able to inspect every variable makes debugging so much easier when you are new at programming. Especially with the GUI and variable explorer.
- ModernMech 4y ago> being able to inspect every variable makes debugging so much easier when you are new at programming. I'd go further to say this is useful for anyone with any level of experience programming!
- rightbyte 4y agoGlobals are bad, m'kay?
- tmalsburg2 4y agoTons and tons of legacy code in academia. The cost of re-implementing it in Julia or similar is prohibitive.
- hules 4y agoWell the licence fee of matlab is pretty massive (2500€ / user, and then each toolbox is 500 or 1000 euros each..), and then you have do deal with activation issues if you happen to switch computers quite often. Octave is a good alternative to run your matlab code if you don't need the "fancy" matlab ide. The octave interpreter is slower than matlab, but that's because there is a JIT compiler in matlab. octave is still a good tool in my opinion.
- signaru 4y agoThe one thing I miss from Matlab's IDE is the ability to properly rename variables. Octave lacks this (not sure about this new release) and I so far haven't found a Matlab/Octave LSP that can be used for other code editors.
- tpoacher 4y agonew = old; clear old; Or if you're a gui person, right click on a variable in your workspace and click Rename
- enriquto 4y ago> Why use Octave instead of R, Python, or Julia? I use Octave daily, for many numerical tasks (and also python and julia). It has some advantages with respect to Python: 1. The sparse linear solvers in octave are considerably more performant than those available in a default scipy install. 2. No need to import external libraries written in other languages just to multiply two matrices. 3. Translating a formula from the blackboard to octave is really straightforward. This is often not the case for numpy. As for julia, the base language is even better than octave. However, it is not as useful for one-off scripts due to the slow startup time. You can use octave as a calculator for your shell scripts. For instance, one day I had to warp a collection of images by a collection of affine maps; the affine maps were the product of two matrices stored in individual files. Thus I wrote a three-line shell loop that called octave for each file and did the deed. The loop processed 200 files in five seconds (even without parallelism). In julia this would take a few minutes.
- Nanana909 4y agoFor one off Julia scripts consider using https://github.com/dmolina/DaemonMode.jl https://github.com/dmolina/DaemonMode.jl
- nwvg_7257 4y agoI would encourage you to try this again on Julia 1.8. Startup time has improved a lot. A few minutes seems way too long to process some images. Even plotting should happen within 20-30s now.
- doodlesdev 4y agoPossibly related recent discussion: https://news.ycombinator.com/item?id=35106488 https://news.ycombinator.com/item?id=35106488
- enriquto 4y agoWill try! The image warping was done by an external program. Julia was used just to multiply two matrices of size 3x3 for each image in the collection. Launching the interpreter took almost a whole second, the rest of the computation was instantaneous.
- deleted 4y ago[deleted]
- rightbyte 4y agoThere is a VM for Octave in the works in the mailing lists. I tried it. Speeds up execution times by alot.
- abdullahkhalids 4y agoThe difference between Matlab/Octave and Python/Julia is the difference between Windows and Linux. Windows is a product that is designed to get out of the way, so the user can do what they are actually interested in (watching movies/doing business tasks), and the Linux is constantly in your face about your freedoms and which combination of libraries and packages you need [1]. To learn and use Matlab/Octave requires learning very little programming or the intricacies of programming. To use Python, one has to figure out packages and libraries and object-oriented programming. To even use Julia, which is much better, one has to think about, how can I write my code to avoid the initial JIT delay. When I am thinking science, I don't want to think about any of those things. I want to think about science and science alone. The intricacies of the programming language should not bother me. [1] I say this as a 15 year exclusive linux user.
- throwawaymaths 4y ago>Windows is a product that is designed to get out of the way, I get your drift but I think your analogy is opposite. I absolutely could not function in windowsland because it's constantly getting in the way of what I want to do whereas Linux just works.
- joseftexas 4y agoMaybe because you have a niche Linux uses and very specific distro. On Windows, there are no distro and no gui manager. Everything works. I have been to old folks home teaching computing. From starting Windows to surfing Internet to print out take less than 15mins. The teaching is very straight forward. The same for Linux which I taught a bunch of teenagers are nightmare when they bring their own laptops. So many drivers missing and breakage here and there. The irony is that wsl actually save the day because it just works. I can setup a scenario where closing my eyes and select 25 brands and install python anaconda and minecraft to just work. I can bet 100K usd you cant do the same in the same amount of time on Linux of ANY distro of your choosing. Simply you are damn good with your specific Linux and your niche habits doesnt translate to majority computer users worldwide. Take building controls very specific niche, Linux equivalent GUI server simply rare and usually lack the full feature of Windows equivalent. Yes, one can run Win VM in Linux to get it done, but boy that is getting complicated for engineers working in that field.
- tpoacher 4y agoYou should use it because it's a super cool language, it's open source, and if people used it more to develop the package ecosystem a bit more, it would easily end up trumping all the others you mentioned. Anecdotally, I used Octave during my PhD and it was a breath of fresh air (where matlab wasn't, for reasons I cant quite explain myself tbh). I have also used (and still use) R, Python, and Julia. Octave is still the language I go to first to get things done fast.