>>12217111matlab is a heap of shit. it sells itself as easy, but try to program anything non trivial and the language works against you at every turn. it has fundamentally broken language design that encourages antipattern after antipattern. the libraries are buggy and have inconsistent interfaces. unless you are required to learn matlab for a class or to talk with peers, use something else. python+scipy isn't exactly efficient either, but it has a lot more eyes on it and (somewhat) better design.
t. matlab expert
>>12217124>Just don't use for loopsthis is one of the worst offenders here. computers are _really_ good at looping. however to be efficient in matlab you need to vectorize your loops using the array notation. unfortunately not everything can be vectorized (you can only vectorize a few operations at a time), vectorization is akin to premature optimization, and it can be hard to spot a good way to vectorize code. for loops are a natural way to program, and forcing coders to hide their for loops makes coding much more difficult and reading someone's code equally difficult, especially when arrays are constantly getting reshaped, squeezed, and sliced to make vectorization possible.
fuck matlab