SQL

Matlab me like an empty array

Posted on Updated on

The Good
One of the things that I like most about Matlab is that it can be really easy to accomplish tasks that are quite cumbersome in other languages. Having the ability to model structures and explore data is great. I think the graphing / charting libraries are one of its strongest suits.

The Bad
On the other hand the problem with Matlab is that it can be maddeningly frustrating at times as well. Some things that are incredibly easy to do in other languages (Python,Ruby, and even C for gods sake !!) are difficult/impossible/or non-obvious in Matlab. (or require special tool-boxes)

A perfect example of how frustrating it can be is the complete lack of a ‘push’ or ‘pop’ method for the matrices. Who would have ever thought that such a high level language that is geared entirely towards matrices would be missing these key features. How cruel!

After some toying around I have found a kind of a replacement for push, but it lacks the finesse of true syntactical sugar:
a=[];
for xx=1:10
a(end+1)=xx;
end
%Tada! its as easy as that

Of course you should always try to pre-initialize your variables for performance reasons, yadda yadda… but the truth is sometimes this is more convenient.

The Ugly
Or what about connecting to a database? I don’t know about you, but where I work we have the DB toolbox for Matlab and I refuse to use it because our entire department only shares 4 keys. If 4 other people are running a DB routine at the same time I get locked out of the toolbox. This is entirely unnecessary.
Try MYM instead to connect with a MYSQL database.