In Defense of Matlab Code
41–50 of 174 posts
Re: In Defense of Matlab Code
#42What a terrible article. The author does not understand matlab at all and he is also either lying or totally clueless. Matlab is successful because of precisely one thing, which nobody has replicated. It offers a complete software environment from one source. Nowhere else can you get scientific computing, a GUI toolkit, a high level embedded software environment, a HiL/SiL toolkit, a model based simulation environmen…
>> The engine is closed source. You cannot see how fft or ode45 are implemented under the hood. For high-stakes engineering, not being able to audit your tools is a risk. This is just a lie. Open matlab and you can inspect all the implementation details behind ode45. It is not a black box. How do I see the .c files / trace how `ode45` will execute on my machine? Can I see the JIT's source code? -- Entitled to your vi…
"You cannot see how fft or ode45 are implemented under the hood." is a totally false statement. You absolutely can do exactly that. This is not a matter of opinion. Right click the function and open it, you can view it like any other matlab function.
> From perspective of open / closed source -- maybe for you it qualifies as open source
Matlab is obviously not open source. Who said anything about that? The article claims you can not audit ode45, that is false and it seems pretty embarrassing for someone speaking authoritatively about matlab to make such basic claims, which every matlab user can disprove with two clicks. Every single matlab user has the ability to view exactly how ode45 is implemented and has the ability to audit that function. This is not a matter of opinion, this is a matter about being honest about what matlab offers.
Re: In Defense of Matlab Code
#43> # We must reshape X to be a column vector (3,1) > # or rely on broadcasting rules carefully. > Z = Y @ X.reshape(3, 1) Why not use X.transpose()?
Or just X.T, the shorthand alias for that
Re: In Defense of Matlab Code
#44Earlier quoted context omitted.
Actually, I just tried Y @ X in Numpy and it works just fine. It's because in Python 1-dimensional arrays are actually a thing, unlike in Matlab. That line of code is a non-example; it is easier to make it work in Python than in Matlab.
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…
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
Re: In Defense of Matlab Code
#45It was a very unpleasant feeling when I graduated from my PhD and realized that most, if not all, of the Matlab scripts I had used for my research would now be useless to me unless I joined a company or national laboratory that paid for licenses with the specific toolboxes I had used.
I'm glad that a significant portion of tools in my current field are in open source languages such as Python and Julia. It widens access to other researchers who can then build upon it.
(And yes, I'm aware of Octave. It does not have the capabilities of Matlab in the areas that I worked in, and was not able to run all of my PhD scripts. I have not tried RunMat yet, but am looking forward to experimenting with it.)
Re: In Defense of Matlab Code
#46Earlier quoted context omitted.
>> The engine is closed source. You cannot see how fft or ode45 are implemented under the hood. For high-stakes engineering, not being able to audit your tools is a risk. This is just a lie. Open matlab and you can inspect all the implementation details behind ode45. It is not a black box. How do I see the .c files / trace how `ode45` will execute on my machine? Can I see the JIT's source code? -- Entitled to your vi…
I explicitly pointed out what the article was lying about. "You cannot see how fft or ode45 are implemented under the hood." is a totally false statement. You absolutely can do exactly that. This is not a matter of opinion. Right click the function and open it, you can view it like any other matlab function. > From perspective of open / closed source -- maybe for you it qualifies as open source Matlab is obviously no…
But okay -- as I mentioned, you're entitled to your views!
Re: In Defense of Matlab Code
#47Re: In Defense of Matlab Code
#48Re: In Defense of Matlab Code
#49Matlab is an great tool, if you can afford it. It was a very unpleasant feeling when I graduated from my PhD and realized that most, if not all, of the Matlab scripts I had used for my research would now be useless to me unless I joined a company or national laboratory that paid for licenses with the specific toolboxes I had used. I'm glad that a significant portion of tools in my current field are in open source lan…
And this is why you should write free software and, as a scientist, develop algorithms that do not rely on the facilities of a specific language or platform. Nothing is more annoying than reading a scientific paper and finding out that 90% of the "implementation" is calling a third party library treated as a blackbox.
Re: In Defense of Matlab Code
#50There'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.
https://www.youtube.com/watch?v=kc9HwsxE1OY
I think it seems pretty interesting.