Common tips and solutions:
- Never use
- MATLAB is column-major (down then across)!
- To use
bsxfunto it's full potential and with little effort, know your singleton dimensions and permute (and that
bsxfunoperates on multiple singleton dimensions).
- The shared library search path in Linux comes only from
LD_RUN_PATHin MATLAB, not the usual
Did I mention, never use
My favorite obscure and/or tricky MATLAB stuff:
- Super efficient N-D Cartesian product.
- Dynamic legend.
sprintfc: print into a cell array.
forloop expression (
for var = expr ...) can be a matrix, looping through columns.
- Set membership tests for sorted arrays:
ismembc2, and more.
- Where does
handlesstructure (and other GUI data tricks)?.
- Changing the order of line series colors (
ColorOrder), and the "best" colors.
- Apparently MathWorks did not expect anyone to actually overload curly braces (
accumarrayrocks, but you have to use it right.
- The default C MEX configuration uses ANSI C, which really stinks. Enable C99.
bsxfuncan replicate in multiple dimensions. (most don't know!)
kronto replicate either array elements or whole arrays.
- More moved to my website.
I'm a research scientist focused on medical image processing, machine learning, dimensionality reduction, and parallel computing. I ♥