| ▲ | themeiguoren a day ago | ||||||||||||||||
Of the things matlab has going for it, looking just like the math is pretty far down the list. Numpy is a bit more verbose but still 1-to-1 with the whiteboard. The last big pain point was solved (https://peps.python.org/pep-0465/) with the dedicated matmul operator in python 3.5. Real advantages of matlab: * Simulink * Autocoding straight to embedded * Reproducible & easily versioned environment * Single-source dependency easier to get security to sign off on * Plotting still better than anything else Big disadvantages of matlab: * Cost * Lock-in * Bad namespaces * Bad typing * 1-indexing * Small package ecosystem * Low interoperability & support in 3rd party toolchains | |||||||||||||||||
| ▲ | quietbritishjim 21 hours ago | parent | next [-] | ||||||||||||||||
> Big disadvantages of matlab: I will add to that: * it does not support true 1d arrays; you have to artificially choose them to be row or column vectors. Ironically, the snippet in the article shows that MATLAB has forced them into this awkward mindset; as soon as they get a 1d vector they feel the need to artificially make it into a 2d column. (BTW (Y @ X)[:,np.newaxis] would be more idiomatic for that than Y @ X.reshape(3, 1) but I acknowledge it's not exactly compact.) They cleverly chose column concatenation as the last operation, hardly the most common matrix operation, to make it seem like it's very natural to want to choose row or column vectors. In my experience, writing matrix maths in numpy is much easier thanks to not having to make this arbitrary distinction. "It's this 1D array a row or a column?" is just over less thing to worry about in numpy. And I learned MATLAB first, do I don't think I'm saying that just because it's what I'm used to. | |||||||||||||||||
| |||||||||||||||||
| ▲ | amluto a day ago | parent | prev [-] | ||||||||||||||||
> Autocoding straight to embedded I used this twenty-something years ago. It worked, but I would not have wanted to use it for anything serious. Admittedly, at the time, C on embedded platforms was a truly awful experience, but the C (and Rust, etc) toolchain situation is massively improved these days. > Plotting still better than anything else Is it? IIRC one could fairly easily get a plot displayed on a screen, but if you wanted nice vector output suitable for use in a PDF, the experience was not enjoyable. | |||||||||||||||||