Live data from Hacker News

Matlab is oversold as a general-purpose language

abandonmatlab.wordpress.com

31–40 of 104 posts

Re: Matlab is oversold as a general-purpose language

#31

Earlier quoted context omitted.

I've been working with Matlab for years and have been quite intrigued by claims that SciPy is the new, better, Matlab. But every time I tried it, it felt like a cheap knockoff. For example, let's say I want to apply DCT to a matrix. In Matlab it's simply dct(A). How do you do that in Python? Well, there's scipy.fftpack.dct, but when I try it, it turns out it operates on the rows of A, instead of the columns. So I sta…

So, basically, you're panning the massive open collaborative effort behind SciPy/NumPy/Pandas because you can't be bothered to learn a slightly different and more flexible syntax? Because that's what it sounds like.

Having the dct operate row-wise is not a different syntax, it's broken. The dct is a linear transformation and linear transformations operate on columns, not on rows. (Unless you apply them to the transpose of the matrix, which is what the SciPy dct is doing.)

Re: Matlab is oversold as a general-purpose language

#32
post #8

For something to be oversold... it has to be sold as something in the first place. I work at a company which uses Matlab extensively. I don't think anyone here views Matlab as a general-purpose language, even though you can put together some fairly fancy things in it. What we do view Matlab as is an exceptional domain-specific matrix manipulation and data visualization language. The IDE is exceptionally easy to use,…

I've been working with Matlab for years and have been quite intrigued by claims that SciPy is the new, better, Matlab. But every time I tried it, it felt like a cheap knockoff. For example, let's say I want to apply DCT to a matrix. In Matlab it's simply dct(A). How do you do that in Python? Well, there's scipy.fftpack.dct, but when I try it, it turns out it operates on the rows of A, instead of the columns. So I sta…

Numpy, Scipy and Matplotlib aren't a 100% clone of Matlab, but they do provide much of similar matrix manipulation and data visualisation tools.

Where they really shine though, is scientific code that needs to do a bit more than numerical computation. I've tried Matlab briefly, and it was hell. Things like parsing strange text files for the source data, scraping data from websites, pulling data in from a SQL database, or publishing the computation as a web service are all easy with Python.

Spending a small bit of extra time on the core matrix code is okay to get the rest of the Python ecosystem and libraries (and even for loops that make sense).

Re: Matlab is oversold as a general-purpose language

#33
post #20

Mathematica, on the other hand, is brilliant. It's a wonderful language with wonderful libraries and functionality, and it's quite clear how to write robust code in it.

I'm not familiar with your commenting style. Is this straight up or dripping with sarcasm?

My favorite example. The chosen answer to the "Where's Waldo?" solution is 7 lines long. http://stackoverflow.com/questions/8479058/how-do-i-find-wal...

Re: Matlab is oversold as a general-purpose language

#34
post #13
post #3

I'm surprised he's not railing against LabView and Origin too.

Random "LabVIEW isn't a general purpose programming language...except it kinda is" story: About a decade ago, my then-boss dragged me to a weeklong LabVIEW training course. The course was geared toward scientists and engineers (like my boss — I was sysadmin/programming/IT), and the instructor wanted people to bring data, problems, etc. from their own research to work on during the "hands-on" afternoons. I didn't have…

Yes, the cool thing about LV is allows you to turn an idea on a flow chart into code that resembles the original chart on the high level. And, nothing beats it for data acquisition and testing. Like all visual languages big projects and the finer implementation details can get ugly.

Most people focus in LV's visual programming paradigm. But I think its real power come from the Flow Based Programming model. Functional programming is the trendy solution to the problem of concurrency these days. But I think FBP could offer some solutions in this domain too. NoFlo looks a promising new technology in this area. http://noflojs.org/

Re: Matlab is oversold as a general-purpose language

#35
post #20

Earlier quoted context omitted.

I'm not familiar with your commenting style. Is this straight up or dripping with sarcasm?

Serious. Super serious. No, really, Mathematica is great. It can do some amazing things and it's really easy to write reusable code for.

What advice or pointers would you give to start learning & using mma for real problems?

I tried to learn it a few times and it worked great for toy problems, but when I tried to write an entire script a la python/c/matlab, I failed miserably

Re: Matlab is oversold as a general-purpose language

#36
post #3

I'm surprised he's not railing against LabView and Origin too.

I have written a bunch of programs for interfacing with instruments and when I started doing that I was using labview but it was such a pain. It was liberating when I found that VISA has python bindings. I now do all the instrument-interfacing code in Python+Qt. It is so much more productive that it makes me wonder why do people still want to use labview for this kind of job. I mean its visual language is complicated that it makes even the simplest things (like formatting a string) difficult. And on the top of that if you try to make something more complex the block diagram is completely unreadable. Madness.

Re: Matlab is oversold as a general-purpose language

#39
post #3

I'm surprised he's not railing against LabView and Origin too.

I have written a bunch of programs for interfacing with instruments and when I started doing that I was using labview but it was such a pain. It was liberating when I found that VISA has python bindings. I now do all the instrument-interfacing code in Python+Qt. It is so much more productive that it makes me wonder why do people still want to use labview for this kind of job. I mean its visual language is complicated…

It all boils down to using the right tool for the job. If you need performance, C will blow python out of the water. If you need a quick solution that’s light on data acquisition and heavy on algorithms, python will probably be a better choice. I’ve run into a highly concurrent, signal processing tasks handled beautifully with LabVIEW and its built in SP modules. Python would have been a terrible choice for that application.

Re: Matlab is oversold as a general-purpose language

#40
post #33
post #20

Earlier quoted context omitted.

I'm not familiar with your commenting style. Is this straight up or dripping with sarcasm?

My favorite example. The chosen answer to the "Where's Waldo?" solution is 7 lines long . http://stackoverflow.com/questions/8479058/how-do-i-find-wal...

The solution is basically a cross correlation in a colour channel between the image and a zebra pattern. That can be done in a few lines in more than one language.

Also, 7 lines is hardly a good metric to judge the general effectiveness of an environment or language.

Post reply on HN