Stories
Slash Boxes
Comments

SoylentNews is people

SoylentNews is powered by your submissions, so send in your scoop. Only 15 submissions in the queue.
posted by janrinok on Monday June 01 2015, @07:28PM   Printer-friendly
from the plot-this dept.

I wasn't aware of the GNU Octave project until I saw a post on Reddit that it had hit version 4.0.0. If you're not familiar with it either, here's a brief overview:

GNU Octave is a high-level interpreted language, primarily intended for numerical computations. It provides capabilities for the numerical solution of linear and nonlinear problems, and for performing other numerical experiments. It also provides extensive graphics capabilities for data visualization and manipulation.

So why is this exciting? Aside from a Windows installer for all you people too lazy to switch to GNU/Linux, it apparently finally got a GUI (kind of a must for "modern" software):

Octave 4.0 is a major new release with many new features, including a graphical user interface, support for classdef object-oriented programming, better compatibility with Matlab, and many new and improved functions.

You can also get the full list of user-visible changes here.

Share and enjoy!

Related Stories

MATLAB vs Python: Why and How to Make the Switch 30 comments

MATLAB and Python are both rather popular languages. Real Python has an overview of the two with an eye towards encouraging use of Python. There is a lot to say when comparing languages, so this is a long read.

MATLAB® is widely known as a high-quality environment for any work that involves arrays, matrices, or linear algebra. Python is newer to this arena but is becoming increasingly popular for similar tasks. As you’ll see in this article, Python has all of the computational power of MATLAB for science tasks and makes it fast and easy to develop robust applications. However, there are some important differences when comparing MATLAB vs Python that you’ll need to learn about to effectively switch over.

In this article, you’ll learn how to:

  • Evaluate the differences of using MATLAB vs Python
  • Set up an environment for Python that duplicates the majority of MATLAB functions
  • Convert scripts from MATLAB to Python
  • Avoid common issues you might have when switching from MATLAB to Python
  • Write code that looks and feels like Python

Earlier on SN:
Python's Guido van Rossum Steps Down (2018)
What's Today's Top Language? Python... no, Wait, Java... no, C (2017)
GNU Octave - Open Source Answer to Matlab - Hits 4.0.0 (2015)
You Want MatLab on Your Resume to Get a Job at Google (2014)
Why Python is Slow: Looking Under the Hood (2014)


Original Submission

This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 0) by Anonymous Coward on Monday June 01 2015, @07:38PM

    by Anonymous Coward on Monday June 01 2015, @07:38PM (#190841)

    Enough of the Matlab monopoly. Enough, I say!

    GNU Octave is pretty cool, and does quite a bit. No reason it can't be used as at least a partial replacement (especially for undergrad coursework in University).

  • (Score: 2, Informative) by Anonymous Coward on Monday June 01 2015, @07:44PM

    by Anonymous Coward on Monday June 01 2015, @07:44PM (#190845)

    Whilst Octave is nearly code compatible with Matlab, Julia is a fresh look at a faster, better numerical computing language. Seriously, look at Julia.

    • (Score: 4, Informative) by AnonTechie on Monday June 01 2015, @08:09PM

      by AnonTechie (2275) on Monday June 01 2015, @08:09PM (#190855) Journal

      Julia is a high-level, high-performance dynamic programming language for technical computing, with syntax that is familiar to users of other technical computing environments. It provides a sophisticated compiler, distributed parallel execution, numerical accuracy, and an extensive mathematical function library. http://julialang.org [julialang.org]

      --
      Albert Einstein - "Only two things are infinite, the universe and human stupidity, and I'm not sure about the former."
      • (Score: 2) by FatPhil on Tuesday June 02 2015, @10:54PM

        by FatPhil (863) <reversethis-{if.fdsa} {ta} {tnelyos-cp}> on Tuesday June 02 2015, @10:54PM (#191331) Homepage
        How about Sage? http://www.sagemath.org/ I've never used it myself but I see it mentioned quite frequently in such contexts (I only use Pari/GP for the kinds of things I need.)
        --
        Great minds discuss ideas; average minds discuss events; small minds discuss people; the smallest discuss themselves
    • (Score: -1, Flamebait) by Anonymous Coward on Monday June 01 2015, @08:12PM

      by Anonymous Coward on Monday June 01 2015, @08:12PM (#190856)

      Because it's "for the cloud"!! Oooooooh.

      • (Score: 0) by Anonymous Coward on Monday June 01 2015, @09:21PM

        by Anonymous Coward on Monday June 01 2015, @09:21PM (#190882)

        I know you Julia guys have a huge R chip on your shoulder (pretty much every web page has something to the effect: "See, we really are better than R!"), but geez, why not grow up and grow a pair instead of modding me down?

        I know. How about you just STFU until you've stopped fucking around with basic functionality and you actually are something useful to use? Want to do some curve fitting? Well, you need to call "curve_fit" from the Optim package. Oops! My bad! It is in the LsqFit package, and we've decided to change what the function returns. I hope that didn't fuck up any of your code. It's easier for me to just slap it together in Octave than to try to sort out your dicking around. What, is Julia written in PHP or something, that it has to fundamentally break shit on version releases?

        • (Score: 2) by physicsmajor on Monday June 01 2015, @10:00PM

          by physicsmajor (1471) on Monday June 01 2015, @10:00PM (#190905)

          If you like Julia but want more maturity/stability, check out the Scientific Python Stack (SciPy, NumPy, Pandas, Simpy, Matplotlib, and Nose) plus scikit-* for more specialized tasks like machine learning or image analysis.

          • (Score: 3, Funny) by kaszz on Monday June 01 2015, @11:42PM

            by kaszz (4211) on Monday June 01 2015, @11:42PM (#190954) Journal

            And if you don't like Python tabulation nazism? ;-)

            • (Score: 4, Interesting) by physicsmajor on Monday June 01 2015, @11:58PM

              by physicsmajor (1471) on Monday June 01 2015, @11:58PM (#190961)

              For a language that deliberately decided to do away with braces or other markings of scope, using tabulation is just... prudent in Python. PEP8 isn't always a perfect standard, but simply having a standard makes the majority of code more readable/accessible/maintainable to the rest of the community.

              I will admit I have a soft spot for standards that tell you to ignore the standard if you think it makes things worse ;)

              I do understand those who don't like it, but personally I find the result incredibly clean and readable. The only valid criticism I've heard is that one can get "lost" with multiple tab levels, but with a quality editor you get a subtle mark at each stop. I know I'd much rather track indentation than attempt to hunt through and verify brace closures...

          • (Score: 3, Informative) by Anonymous Coward on Tuesday June 02 2015, @03:00PM

            by Anonymous Coward on Tuesday June 02 2015, @03:00PM (#191158)

            Scipy/Numpy/etc is really useful. However, the Julia syntax is much slicker for numerical tasks, since that was the original purpose. I've been using Julia for quite a bit of my own work. Since it can be nearly as fast as C, development is sped up by not having to write things in Fortran/C.

            Critically, there is a package, PyCall, to call Python code. To do a simple plot with matplotlib:

            using PyCall
            @pyimport matplotlib.pyplot as plt
            x=rand(10)
            y=rand(10)
            plt.plot(x,y)
            plt.show()

            You can barely tell the matplotlib parts are calling out to python. Lisp-style homoiconicity really allows for some pretty cool stuff.

    • (Score: 2) by MichaelDavidCrawford on Monday June 01 2015, @09:53PM

      I've never actually use it as I prefer to write numerical code in C++. Sometimes I write it in FORTRAN but I do so when working with someone else's FORTRAN code such as CERNLIB.

      What leads me to regard MatLab as so bad is its programming language. While I haven't written any I have attempted yet strictly speaking failed to read some. While I can see the point of a Free Software clone, the clone of garbage is still garbage.

      Ironically MatLab experience is a common requirement for embedded systems employment. That means I can't even apply for a lot of work I would otherwise be quite good at, as Computational Physics was my main area of focus during my studies both at Caltech and at UCSC. It's much like my recent gripe about being required to have a GitHub account - it doesn't count that one maintains one's own git repo; that's not the same as having an account that any damn fool can sign up for.

      --
      Yes I Have No Bananas. [gofundme.com]
      • (Score: 2) by novak on Tuesday June 02 2015, @09:39PM

        by novak (4683) on Tuesday June 02 2015, @09:39PM (#191287) Homepage

        As someone who has written matlab professionally, I agree entirely. The language is poorly made for general use and extremely slow. Just play around with named pipes on linux and you'll see what I mean. When analyzing non-trivial data sets who in their right mind would choose an interpreted language with java internals? Not a real numerical programmer. For problems involving dynamic allocation of large amounts of memory it clocks in (according to my benchmarks) about 2X slower than python and 100x slower than C or FORTRAN.

        But because it has a nice GUI and is given to universities for free it is seen as a valid software language instead of a $20K desktop version of a graphing calculator. But how many undergrads even know what a runge-kutta solver is, let alone how to write their own? People tell them to "just use matlab" and they do, to the detriment of the entire industry.

        --
        novak
        • (Score: 2) by MichaelDavidCrawford on Wednesday June 03 2015, @01:32AM

          by MichaelDavidCrawford (2339) Subscriber Badge <mdcrawford@gmail.com> on Wednesday June 03 2015, @01:32AM (#191378) Homepage Journal

          I told my students to use any language they pleased. Most used either basic or fortran; I learned C when I took the course myself. Someone I call "Cipher" used APL, went on to get a PhD in Math and is now an NSA cryptologist.

          But now that same class uses MATLAB. That doesn't make a whole lot of sense to me; I'd think that they'd want to teach people to create programs like MATLAB. For Caltech's Computational Physics to use MATLAB would be like Ford Motor Company employing the United Auto Workers to ride around in taxicabs.

          We were taught runge-kutta right from the start. My very favorite program - that I still have though not readily at hand - was a planetary orbit simulation, written in basic, in which a rogue star captures the earth then flings it into interstellar space.

          You'd think a program like that, in basic on an 8086 would be quite slow, or at least inaccurate but no it was fast, and the orbits would stay elliptical for quite a long time if that rogue star didn't turn up.

          --
          Yes I Have No Bananas. [gofundme.com]
          • (Score: 2) by novak on Wednesday June 03 2015, @04:13PM

            by novak (4683) on Wednesday June 03 2015, @04:13PM (#191652) Homepage

            Very cool. I did some orbital mechanics simulations myself, including a differential corrections algorithm for L1 halo orbits and a 3-DOF reentry simulator, and I usually program in C. I'm at a much lower level of education than you as I only have a bachelor's degree but there are still some of us who learn how to program properly, even with matlab everywhere.

            --
            novak
    • (Score: 0) by Anonymous Coward on Tuesday June 02 2015, @01:22AM

      by Anonymous Coward on Tuesday June 02 2015, @01:22AM (#190977)

      I really want to like Julia but the problem with it is, it always ends up looking like C++.

  • (Score: 1) by shrewdsheep on Monday June 01 2015, @07:53PM

    by shrewdsheep (5215) on Monday June 01 2015, @07:53PM (#190850)

    qtoctave has been a decent GUI for a long time.

  • (Score: -1, Troll) by Ethanol-fueled on Monday June 01 2015, @08:00PM

    by Ethanol-fueled (2792) on Monday June 01 2015, @08:00PM (#190852) Homepage

    " ...for all you people too lazy to switch to GNU/Linux, "

    Uh, I don't think "lazy" is the word for it...

    " Octave 4.0 is a major new release with many new features, including a graphical user interface... "

    Graphical user interfaces were "new" in the '70's. And Loonix weenies are scratching their heads wondering why everybody hasn't switched yet.

  • (Score: 2) by VLM on Monday June 01 2015, @08:00PM

    by VLM (445) on Monday June 01 2015, @08:00PM (#190854)

    I've always used it spreadsheet-y style, here's a hideously complicated script that outputs a number at the end, now mess with the script until that number at the end "works" using git and what ever else to store my script. I'm not sure how that would fit in, if at all, with GUI style use. emacs is my gui, kinda.

    "well i clicked the mouse 7000 times to get an almost good result and now I need to roll back to 6000 times on a different git branch" hows that work in a gui?

    It is a very versatile tool, usable in many different ways.

  • (Score: 2, Funny) by Anonymous Coward on Monday June 01 2015, @08:32PM

    by Anonymous Coward on Monday June 01 2015, @08:32PM (#190861)

    GNU is Not Unix, Octave is Not Matlab, Linux is Not GNU, SoylentNews is Not Slashdot

    • (Score: 2) by takyon on Monday June 01 2015, @08:50PM

      by takyon (881) <reversethis-{gro ... s} {ta} {noykat}> on Monday June 01 2015, @08:50PM (#190872) Journal

      If it's based on another open source project, that's just forking.

      Open source has become bigger in recent years, so it's no surprise that existing closed source software set the standard that professionals look to.

      --
      [SIG] 10/28/2017: Soylent Upgrade v14 [soylentnews.org]
      • (Score: 1, Funny) by Anonymous Coward on Monday June 01 2015, @09:05PM

        by Anonymous Coward on Monday June 01 2015, @09:05PM (#190879)

        Closed source software is where innovation happens because smart people want to get paid for their original work leaving all the stupid people to do open source junk for free.

        • (Score: 0) by Anonymous Coward on Monday June 01 2015, @09:28PM

          by Anonymous Coward on Monday June 01 2015, @09:28PM (#190885)

          That's funny. You've clearly not written much closed source software. Most of your "innovation" is stupid UI bullshit, and the rest is illegally poaching open source software and hiding it behind a binary. And if it isn't poached, it is just reusing BSD-licensed code. You get innovation because you like the code you're writing and you have an attachment to it such that you WANT to stay up late working on it. Closed source software, you are slogging your way through code you hate because you write it by committee and you're just a Code Monkey who hates his job because the code sucks, you know it sucks, but you aren't even allowed to fix it before you throw it over the fence to the morons in "QA", who couldn't recognize a test case if it came up and kicked them in the ass.

    • (Score: 2) by maxwell demon on Monday June 01 2015, @09:17PM

      by maxwell demon (1608) on Monday June 01 2015, @09:17PM (#190881) Journal

      Slashdot was once Open Source (guess what code this site's code is based on?). Please tell me what it was a clone of in your opinion.

      --
      The Tao of math: The numbers you can count are not the real numbers.
  • (Score: 2) by MichaelDavidCrawford on Monday June 01 2015, @09:01PM

    not open source. It's not about the choice of license but why the license was chosen.

    Go find the thread where linus gets into it with someone who referred to linux as free software.

    However some "GNU" projects aren't really backed by the Free Software Foundation; in those cases they might be open source rather than free software.

    --
    Yes I Have No Bananas. [gofundme.com]
    • (Score: 3, TouchĂ©) by maxwell demon on Monday June 01 2015, @10:10PM

      by maxwell demon (1608) on Monday June 01 2015, @10:10PM (#190912) Journal

      Given that its homepage is on www.gnu.org, it should indeed be part of the GNU project.

      --
      The Tao of math: The numbers you can count are not the real numbers.
      • (Score: 2) by MichaelDavidCrawford on Monday June 01 2015, @10:16PM

        Consider Richard's gripe that Gnutella is not only not free software, but completely proprietary in that the source is not available.

        Sourceforge was effective at discouraging that by not permitting projects to use "gnu" in their name unless they were really part of the GNU Project.

        There is also the GNU and Non-GNU sections of that sourceforge clone the FSF operates, whose name escapes me just now.

        --
        Yes I Have No Bananas. [gofundme.com]
        • (Score: 1, Informative) by Anonymous Coward on Tuesday June 02 2015, @01:25AM

          by Anonymous Coward on Tuesday June 02 2015, @01:25AM (#190979)
        • (Score: 1, Interesting) by Anonymous Coward on Tuesday June 02 2015, @12:44PM

          by Anonymous Coward on Tuesday June 02 2015, @12:44PM (#191115)

          But I strongly doubt that there was ever a false "GNU" project hosted on www.gnu.org.

  • (Score: 3, Insightful) by richtopia on Monday June 01 2015, @10:05PM

    by richtopia (3160) on Monday June 01 2015, @10:05PM (#190908) Homepage Journal

    ...they need it.

    Not to undermine Octave's accomplishments, but more to highlight how much money is available to MATLAB. I've used both, with my projects on a number of occasions starting on Octave and moving to Matlab when the IT department grants me a license. The speed difference is huge (MATLAB is faster).

    It is also faster to write in MATLAB, thanks to the very useful GUI. MATLAB typically is written by people who don't want to code, so the GUI is huge in making their lives easier. On top of that there are advanced toolboxes giving lots of functionality that you need to write from scratch in Octave. I still have yet to see a good alternative to Simulink - even closed source struggles competing here.

    I still have Octave available - in my "Portable Apps" directory of my USB key. However beyond that I just don't use it much anymore.

    • (Score: 5, Interesting) by physicsmajor on Monday June 01 2015, @11:04PM

      by physicsmajor (1471) on Monday June 01 2015, @11:04PM (#190935)

      Octave is basically trying to be like Wine - it's imitating MATLab including all of its faults, because that's what people are familiar with.

      That doesn't make it the best, or even a good tool for the job. It's a good bridge to bring people from closed into open source tools.

      If you want speed and performance, while retaining optimal usability, try Python. It's not a reimplementation of MATLab, but a massive improvement (namespaces! unit testing!) and it links into the same low-level libraries for math (BLAS/LAPACK). I've almost always been able to get NumPy code to run at equivalent or better speed to its MATLab counterparts. And when this isn't the case, it's easier to go from Python to Cython (C) than it is to rewrite everything in MATLab.

      The tools are so much better in Python as well - the IPython/Jupyter project has a rich notebook including fun stuff like %profile and %debug which MATLab users can only dream about. The Python Package Index embarrasses MATLAB Central, with more tools which are actually robust and useful than anything available even for purchase through MathWorks. MATLab's machine learning is a toy compared to scikit-learn.

      There are other options as well like Julia, which is faster than Python but has less of the support framework.

    • (Score: 2) by engblom on Tuesday June 02 2015, @04:48AM

      by engblom (556) on Tuesday June 02 2015, @04:48AM (#191031)

      A huge part of the GNU programs are badly made. Performance issues does not surprise me at all. FSF and GNU is not in first hand about getting excellent programs, it is about getting free programs, with quite a bit of features. Sometimes this means bad performance, sometimes it means really buggy programs, sometimes also good programs comes out.

    • (Score: 0) by Anonymous Coward on Tuesday June 02 2015, @05:12PM

      by Anonymous Coward on Tuesday June 02 2015, @05:12PM (#191195)

      I work in a research environment and I see more of my colleagues moving away from Matlab and IDL because they very expensive, and they are a real PITA dealing with the licenses and license servers. If you are in an academic environment, cost might not be an issue, but they really nail you for a non-academic license. And don't forget the back support they'll charge you. Of the people I know that are moving their code, most seem to be moving in the Python direction.

      I've always seen the toolbox part of Matlab as a detriment, not an advantage. I get inundated with brochures about all the wonderful and great things Matlab can do for me, but it always boils down to whatever wonderful thing it is, you need to purchase yet another toolbox to do it. I've even gone to one of their day-long free courses (on signal processing or image processing, or something like that) and the whole thing was "if you purchase a license for this toolbox, this is how you use it".

      I don't know about Matlab, but IDL has started putting Python hooks in so that you can call IDL functions from Python. They're doing this because they see users converting/rewriting their code.

  • (Score: 0) by Anonymous Coward on Tuesday June 02 2015, @02:15PM

    by Anonymous Coward on Tuesday June 02 2015, @02:15PM (#191141)

    Share and enjoy!

    Does it come with a genuine people personality?