11 ms·
GNU Octave 6.1.0
- tutfbhuf 6y agoAsk HN: Can GNU Octave be used as full MATLAB replacement?
- oytis 6y agoFor me Simulink has always been the biggest missing part. Also RTL (or other code, e.g. for DSP chips) synthesis for Octave is pretty non-existent AFAIK.
- tpoacher 6y agoI know that they have an XCos interface, but I've never used it (or Simulink for that matter).
- stjohnswarts 6y agoWhen I was doing FPGA work Simulink was very handy for plugging together quick signal processing flows. I kind of miss it, but I've moved on to strictly c/c++ embedded work
- threatripper 6y agoIn a similar sense that LibreCalc is a replacement for Excel.
- qayxc 6y agoWell, I don't think so. LibreCalc is much more competitive in terms of performance. Octave doesn't even come close to MATLAB performance especially when dealing with large datasets and plots.
- viraptor 6y agoDepends what your expect from it. It got me through University and I had a much better experience with it than most others had with MATLAB. But I used it for maths during compsci. I suspect it's different for engineers trying to use existing code packages to solve mechanics problems for example.
- forgotpwd16 6y agoDepends. If it is about the base language then it should be. But if you're using toolboxes then Octave's packages have numerous unimplemented functions compared to their MATLAB counterpart. And in genera keep in mind that compatibility isn't perfect.
- chriszhang 6y agoWhen I left university and did not have access to MATLAB anymore, I spent many a nights hacking away at GNU Octave. I have fond memories of Octave. I thought Octave will be a valuable skill when I enter the industry but I could not have been more wrong. Does anyone still use Octave? Is it worth learning? What tools or languages would you recommend as alternatives to someone graduating from university today?
- zorked 6y agoI've seen people use Octave in their workstations but I never worked where Octave code was used in "production". It was more of a individual prototyping/exploration tool for those who knew it.
- CarVac 6y agoI have Octave code running in production.
- chriszhang 6y agoWhat does your Octave code do in production, if you don't mind me asking?
- CarVac 6y agoIt's a matching routine for picking closely matched pairs of sensors for differential measurement.
- WJW 6y agoAFAICT, Python and associated tooling (numpy, Pandas) are taking over many parts of industry where Matlab used to be king. For the rest, it really depends what you mean with "the industry". Different sectors have different languages.
- tpoacher 6y agoMy biomedical engineering thesis was entirely coded on octave, and I still use it daily even though my current employment does not directly relate to it code-wise. Also, while perhaps this example is overplayed, Andrew Ng's hugely successful coursera nanodegree on Machine Learning is taught on octave. Andrew Ng explains the reasons for this beautifully in his course, and I agree. As for "I thought it would be a valuable skill; I could not have been more wrong", it depends. To remove the obvious comment, there is octave, matlab, and octave/matlab. Matlab is still 100% huge in the industry, and getting into this path through octave is at least equivalent, if not better (given you also have to learn more under-the-hood concepts than you might have to in matlab). However, I will assume here that you are referring specifically to the whole "investing in the octave ecosystem on top of already knowing the matlab language" issue. I would argue that octave tends to be more used in teaching and academia, so you're partly right. But at the same time, I would argue that as an open source project, the opportunities for participation and the transferable skills you can get from that are extremely relevant in any resume.
- wallwart 6y agoI've always preferred MATLAB to Python as the more engineer-friendly programming language. The interface was a plus as well. That being said, given the sheer amount of scientific libraries for Python and universities moving towards it as well, I'm wondering if the effort to maintain Octave is worth it. One use for it could definitely be running older MATLAB scripts that have deprecated language features. Those were a real pain to make work again.
- tpoacher 6y agoIn my opinion it is absolutely 100% worth "developing" Octave (the word 'maintain' makes it sound like it's an otherwise static project). The improvements from 3 to 4 were massive. The improvements from 4 to 5 equally so. I can't wait to try 6. In any case, it is definitely not just a tool for running 'old matlab scripts'. It is a beautiful language and environment in its own right, and if academia manages to wake up at some point they would invest in it for the open source environment that it is, in a way similar to python, and help it get even more amazing.
- mxcrossb 6y agoThere is still a lot of mathematics that there are matlab scripts for, and not python. I think it depends on how deep you dive into a particular area of course. But I think it’s definitely worth it.
- piokoch 6y agoStill doing many things in Python is a bit more laborious (no surprise and not a drawback of Python, it is general purpose language) than in Matlab/Octave. Plus learning curve is lower for Matlab/Octave, after long years of not using Matlab I've taken some ML course on Coursera that was using Octave and I was able to be productive very quickly.
- bayindirh 6y agoI use both Python and Octave and I can clearly say that one never replaces the other. For quick and dirty scientific PoC or obtaining ground truth, Octave/MATLAB is much better since it handles all the quirks of numerical programming with generally slow but with proven solutions. During development phase of my Ph.D., my professor would scribble something in MATLAB and send it to me with a note "for the given inputs, you should obtain this and that. Attached is the crude math". It was up to me to clean the math, convert it to C++ and make it blazingly fast while solving any attached small but hard problems. I still have a MATLAB license to test these ground truth scripts against my code.
- jp0d 6y agoIs it worth learning Octave/Matlab for ML or Data analysis work? Does anyone use it outside the engineering/scientific research community? Since Andrew Ng teaches his ML course in it, I'm curious. However, I'm wondering if learning Julia or R will be better for my career. I mostly use Python/SQL at work as a data analyst.
- stabbles 6y agoIn terms of current job openings probably R is best. Julia got its first stable release in August 2018, meaning that more companies could be adopting it now, but R has been around since 1995. If you like Python, Julia is probably easy to pick up though. Octave is incredibly slow and no competition for Matlab, Matlab is terrible as a programming language if you're used to Python, so it's likely you wouldn't enjoy your job if it involved Matlab.
- woodson 6y agoIn general, no, especially for typical data analysis tasks. MATLAB used to have an edge in signal processing, but (IMHO) lost it to Python-based solutions (especially when running things on GPUs, ML or not). If you're doing a lot of exploratory data analysis and statistics, R is worth a look.
- jp0d 6y agoThanks for the replies. I did a course on Data Analysis from MIT and used R a bit there. I liked GGplot and RStudio. I don't think Python has anything close to those two. R was a bit harder to learn and I've already forgotten most of it, since I don't use it. I understand that it's based on Scheme and has roots in functional programming. I'm curious about Julia as it's being promoted as one of the fastest languages. I don't see a lot of value in that as I do most of my data intensive (in terabytes) work on pySpark on AWS clusters before I touch Pandas or any other BI tool. I couldn't use Julia on my laptop to do that! I guess sticking to R has more short term benefit as most courses on Statistics are heavily dependent on R. Julia will probably catch up soon.
- MaxBarraclough 6y agoI know it's not really the point here, but it's nice to see a GNU project with a decent home-page. It's clear, presentable, and modern. (And of course it's not a JavaScript horror-show, but we'd never see that from a GNU project.)
- Zhyl 6y agoYou say that, but I feel like it's a bit of a case of 'dress for the job you want'. Having a modern-ish looking site just gives off some signals like 'this is maintained', 'this has been deemed to still have utility in 2020' and 'the developer has some awareness of current UX'. It doesn't need to be flashy. Just a nice font, a header, centre justification, some spacing, a paragraph explaining what the thing is, a nice logo, maybe some screenshots or a link to the docs and a download link.
- MaxBarraclough 6y agoGNU Lightning has a rather spartan website like you describe: https://www.gnu.org/software/lightning/ https://www.gnu.org/software/lightning/
- dehrmann 6y ago
- tuix 6y agoCurrently you either have MATLAB+Toolboxes or Octave+Packages. I always wondered whether there could be a project to create open source toolboxes that would run in MATLAB. That means no effort is needed to maintain the core language features of MATLAB (of course you would need to buy the basic MATLAB licence without the Toolboxes) in that project and all the energy is spent on developing open-source toolbox replacements (which are typically way more expensive than basic MATLAB licence).
- srtjstjsj 6y agoThe economics don't work well. Softest economy comes from scale, so the best bang for buck is to make free popular things, not to shave $50 off the edge case of your MATLAB outlay.
- 3dsynd 6y agoWhat value can Octave give me, relative to python?
- Zhyl 6y agoCompatibility with MATLAB syntax. If you're in a Mathematical Research or Engineering context then you will likely have some models or systems that someone else has written in MATLAB. If you're writing your own code and you have freedom over your environment then you should pick the best language for your use case.
- Stubb 6y agoA horror show mentally reconciling its one-based indexing with the zero-based indexing you're used to in Python. The use of a zero is admittedly a relatively new concept, and it may not catch on.
- abdullahkhalids 6y agoNot only that. Octave/Matlab indexes end at the last point. x = 0:20, ends at 20, not 19.
- buescher 6y agoA REPL-oriented IDE with integrated debugger and convenient matrix inspection/editing tools. Relatively terse syntax for array/matrix operations.
- danmg 6y agoYou have some crusty MATLAB code that does an analysis exactly the way you need it. It was either written by someone who is long gone, or you don't have the resources to rewrite it in 202x's new computational language.
- enriquto 6y ago> What value can Octave give me, relative to python? For me the main thing is that math is "native", I don't need to import anything to start doing linear algebra. In python, doing math seems like an afterthought. For example, python offers you strings and dictionaries out of the box, but not ndarrays. In Octave, it is exactly the opposite, and it just feels right.
- curt15 6y agoCould this project be threatened by Mathworks if SCOTUS rules that APIs themselves get copyright?
- qayxc 6y agoI don't think so. I imagine it would be very hard for Mathworks to claim copyright over mathematical functions and established terms such as "fft" or "rms". On top of that, Octave isn't even in competition with MATLAB. The much higher performance and capabilities offered by MATLAB that aren't available in Octave (like C++ export including support for GPU acceleration) along with professional support are enough to keep the target audience from considering Octave over MATLAB. Octave isn't encroaching on MATLAB sales, so I don't think such ruling would be an issue as I doubt that Mathworks would even consider legal action. Even if they would for whatever bizarre reason, it'd be sufficient to just change the names and parameters of some functions - lots of work, sure but ultimately not too big an issue. A script could be used to translate between the dialects and people using Octave over MATLAB would continue to do so, since their motivation for choosing Octave wouldn't change due to this. At least that's what I think.
- srtjstjsj 6y agoChanging names isn't a way around a copyright violation.
- deleted 6y ago[deleted]
- ptero 6y agoI wish Octave the best of luck, but it faces an uphill battle against MATLAB (established engineering projects) and Python (new starts). The biggest issue with Octave for me is the slowness of its plotting compared to MATLAB. A major use case for me is visualizing large data sets. I can generate data using any backend (Python, C++, MATLAB, etc.) and want the ability to plot it, zoom in/out to a rectangle, filter to a subset / go back to the full dataset. Simple 2D plotting, no 3D or hard rendering stuff. In such plotting I find Octave (and to a lesser degree Python's matplotlib) super slow compared to MATLAB. To see it, make a scatterplot of 1-5 million points (say, with x and y random, uniformly distributed in [0, 1]). Zoom to a portion a couple of times. MATLAB response is instant, Octave takes seconds. Do the same for 20 million points (which is still a very small dataset by today's standards) and forget about interactive plotting with Octave :(. As I said, I still wish Octave the best and hope it succeeds, but with my student days behind me I prefer to just buy an individual license of MATLAB every 5 years or so for my hobby projects.
- dorfsmay 6y agoIs Julia not the new player in that game?
- sgillen 6y agoJulia is a new player but probably still "too new" for most people (I say this as a Julia fan). Python is a pretty old language at this point, but the data sciencey eco system has only matured relatively recently (compared to the age of Matlab anyway).
- ptero 6y agoIt probably is, but new vs old is not a big decision driver for me. The things that matter to me for scientific computing languages are visualization tools (most critical to me, by far), libraries for standard functionality like optimization and signal processing (not critical as I can use another language for back-end processing) and price. I will try Julia's visualization tools sometime, but if MATLAB is significantly faster will stick to it for now. Just a single user's data point, not claiming that this is a universal view.
- bachmeier 6y agoA general note that applies to some comments in this discussion, but to any discussion of Matlab on HN. Yes, Matlab is still used heavily, even for new code, and it will continue to be used for many years into the future. It doesn't really add much to the conversation to generalize from the small sample that is your slice of one industry/your employer/your inner circle of friends to conclude that Matlab is dead. According to Wikipedia[1], Mathworks had revenue of more than $1 billion in 2019. [1] https://en.wikipedia.org/wiki/MathWorks https://en.wikipedia.org/wiki/MathWorks
- detaro 6y agoNone of the comments right now really suggests Matlab is dead?
- rwlincoln 6y agoI was able to compile GNU Octave 4.4.1 into Web Assembly for my MATPOWER PWA. When Mozilla was still at full force OctIodide might have been an interesting project for them. https://matpower.app https://matpower.app https://github.com/iodide-project/iodide https://github.com/iodide-project/iodide
- pojntfx 6y agoThat's an awesome project! Do you have some guidance on getting Octave to compile on WASM?
- rwlincoln 6y agoSatisfying the BLAS/LAPACK dependency was one of the biggest challenges. I ended up passing LAPACK 3.4.2 through f2c before compiling the result with emcc. PCRE and some SuiteSparse libraries were the only additional dependencies needed for my project and they compiled with Emscripten without too much difficulty. The rest was just hacking GNU Octave's Autotools build system, which gleans a lot of information from the system environment, into working with emconfigure and emmake. My changes to the GNU Octave source code are available here: https://github.com/rwl/octave-4.4.1/tree/web-assembly https://github.com/rwl/octave-4.4.1/tree/web-assembly
- precsim 6y agoThis is very interesting and would never have guessed that it is possible. I would love to read a more detailed write up how all this works (is everything bundled to a large blob for the octave interpreter for example?). Also is the a specific reason you used v4.4.1? And playing with the PWA everything seems instant, but Octave is ~1Gb installed, wouldn't the Octave wasm have to be downloaded to the client (which it doesn't seem to do)?
- rwlincoln 6y agoThe GNU Octave interpreter and its dependencies are all in the matpower.wasm file. 19Mb is still quite large for a website, but it is loaded asynchronously and WASM get compiled as it streams in. The interpreter runs in a WebWorker using a Promise based interface so the UI doesn't get held up. Many of the dependencies (e.g. FFTW, CHOLMOD, ARPACK, Qt, HDF5) are disabled as they are not needed to run MATPOWER. There was no particular reason for using v4.4.1. The core functionality of GNU Octave doesn't change much and that version was stable and sufficient for my needs.
- gnufx 6y agoNot to do down Octave, but if you want a free alternative to MATLAB, Scilab might be worth checking out too, particularly for an alternative to Simulink, as I understand it. It has a different emphasis, like not aiming at compatibility the way Octave does. It grieves me to see how much money squander on MATLAB (and they're apparently not allowed to compare notes, which says something). The ones I'm familiar with pay around (or more than) enough to fund a full-time support post, so there could instead be a significantly-sized sustainable research support team working in that area, just in the UK.
- wrp 6y agoI have used both Octave and Scilab as a substitute for MATLAB. Scilab is a much more polished system, but it has multiple gotchas if you are moving back and forth between it and MATLAB. Octave aims for full MATLAB compatibility, but I found the system pretty rough all around.
- diydsp 6y agoRe simulink: I have experimented with OpenModelica a little bit for making simulations! didn't get too deep, but was impressed with my initial foray.