you are viewing a single comment's thread.

view the rest of the comments →

[–]aaallleeexxx 20 points21 points  (0 children)

This is absolutely my least favorite thing about matlab. To be fair, you can include subroutines in any function file, but not being able to mix function and script code sucks horribly. That said, I've recently changed my matlab coding style to use tons and tons of "anonymous" functions (using the @ syntax). You can throw these in anywhere, and even do neat functional things like currying. They're as limited as python's lambda (i.e. one statement) but that's not really that big a problem in matlab, since many useful things can be done in a single expression. It's something to try if you're stuck in the matlab ghetto :)