Live data from Hacker News

In Defense of Matlab Code

runmat.org

91–100 of 174 posts

Re: In Defense of Matlab Code

#91
post #90

I want to come out and say that a long time ago at a startup we needed to generate a very particular type of analysis graph for a human operator to review in our SaaS. and I just straight up installed GNU Octave on the server and called out to it from python, using the exact code the mathematician had devised.

The most sensible thing I've heard this year.

Re: In Defense of Matlab Code

#93

There's also Julia. Earlier in my career, I found that my employers would often not buy Matlab licenses, or would make everyone share even when it was a resource needed daily by everyone. Not having access to the closed-source, proprietary tool hurt my ability to be effective. So I started doing my "whiteboard coding" in Julia and still do.

Julia competes with the scientific computing aspect of matlab, which is easily the worst part of matlab and the one which the easiest to replace. Companies do not buy matlab to do scientific computing. They buy matlab, because it is the only software package in the world where you can get basically everything you ever want to do with software from a single vendor.

In addition: Simulink, the documentation (which is superb), and support from a field application engineer is essentially a support contract and phone call away.

I say this as someone who’d be quite happy never seeing Matlab code again: Mathworks puts a lot of effort into support and engineering applications.

Re: In Defense of Matlab Code

#94
post #90

I want to come out and say that a long time ago at a startup we needed to generate a very particular type of analysis graph for a human operator to review in our SaaS. and I just straight up installed GNU Octave on the server and called out to it from python, using the exact code the mathematician had devised.

Yeah, this is a pretty common pattern: use a domain-specific tool where it fits (Octave for the math), and a general language for the product glue (Python). Same idea as infra work — lots of teams would rather express intent in Terraform than build it in Rust, because a DSL can be a cleaner fit for the job.

Re: In Defense of Matlab Code

#95
post #90

I want to come out and say that a long time ago at a startup we needed to generate a very particular type of analysis graph for a human operator to review in our SaaS. and I just straight up installed GNU Octave on the server and called out to it from python, using the exact code the mathematician had devised.

For my thesis I did something similar: bash scripts to extract raw data from a Subversion repository, to be preprocessed with PHP scripts (now I would prefer Python but had more experience with PHP) for text extraction and csv output, and finally Octave did the math magic, generating tables and saving graphics in png format, ready for import into my Lyx document.

Re: In Defense of Matlab Code

#96

There's also Julia. Earlier in my career, I found that my employers would often not buy Matlab licenses, or would make everyone share even when it was a resource needed daily by everyone. Not having access to the closed-source, proprietary tool hurt my ability to be effective. So I started doing my "whiteboard coding" in Julia and still do.

simulink is the matlab moat ,not just general math expression

Re: In Defense of Matlab Code

#97

Okay, but what's your business model? We've all been down this road before.

We don’t have a finalized business model yet, right now the focus is getting the open-source runtime solid, useful and very fast. If we add paid stuff later, it’ll be around optional services (not taking features away from the core runtime), and we’ll be clear about it up front.

Re: In Defense of Matlab Code

#98
post #12

As an engineer, I use Matlab (or rather, Octave the free equivalent) all the time. It's really great for numerical computing and plotting. Most things 'just work', there's a sizeable collection of packages, and I personally like how flexible the function inputs are. Biggest drawback though is that it's over-optimized for matrix math, that it forces you to think about everything as matrices, even if that's not how you…

Yes, strings appear like an afterthought, and sadly the Octave version has slight incompatibilities which may be a PITA for any non trivial script which aims to be compatible.

Re: In Defense of Matlab Code

#99
I remember my first encounter with Matlab. Some YouTuber was building a toy rocket and he was simulating it in Matlab (Simulink). He just put in the weight of the rocket and it gave him the trajectory, apogee, flight time etc. It was like magic to a beginner like me.

You can do the same thing in other languages but it won't be built in like that.

Re: In Defense of Matlab Code

#100

Earlier quoted context omitted.

The result of `Y @ X` has shape (3,), so the next line (concatenate as columns) fails. To make `Z` a column vector, we would need something like `Z = (Y @ X)[:,np.newaxis]`. Although, I'm not sure why the author is using `concatenate` when the more idiomatic function would be stack, so the change you suggest works and is pretty clean: Z = Y @ X np.stack([Z, Z], axis=1) # array([[14, 14], # [32, 32], # [50, 50]]) with…

> To make `Z` a column vector, we would need something like `Z = (Y @ X)[:,np.newaxis]`. Doesn't just (Y @ X)[None] work? None adding an extra dimension works in practice but I don't know if you're "supposed" to do that

It seems `(Y @ X)[None]` produces a row vector of shape (1,3),

   (Y @ X)[None]
   
   # array([[14, 32, 50]])
   
but `(Y @ X)[None].T` works as you described:

   (Y @ X)[None].T
   
   # array([[14],
   #        [32],
   #        [50]])

I don't know either RE supposed to or not, though I know np.newaxis is an alias for None.
Post reply on HN