Sprechen Sie MATLAB? This was on an ad-poster by Mathworks that I saw posted on Longin Jan Latecki's office door. No literate can deny how much Computer Science has influenced thinking styles and the pace of research in human quest for knowledge (genomics, bioinformatics, software simulations etc.). MATLAB is one product that has such outstanding influence on many many applied scientific areas (I call applied because I am not sure if MATLAB has led to any purely theoretical insights. By theoretical insights I mean ability to see non-trivial proofs.)
I have used MATLAB for several of my projects. MATLAB is an interpreted language and is known to be slower for 'C-style' programs. But in many cases you need to write blocks of code in 'C-style'. Since MATLAB allows you to interface with C-programs it's worth to know how to write C-programs that you can call in MATLAB without using files as communication (using files again slows down things doesn't it?)
In learning any thing new just don't let "But what if" trouble bother you that much. What if I want to pass pointers, what if I want to pass cell arrays, what if I want to return more than one variable from C etc. Well, you can do all these things but don't worry about all those at once before even getting started, deal one thing at a time. I borrowed this But what if idea from Scott's post about such problem in theoretical perspective which is much more serious! Now let's C how to start building the interface.
The key problem in building any interface is passing around parameters without confusion. The basic anatomy of a typical C-MATLAB file can be seen here. I have simple and clear demonstrations for passing scalars, arrays and structures. The README shows how to use the demos. I recently fixed a memory leak in "kdnn" function of Kd-tree software package for MATLAB written in C by Guy Shecther. You can download the "kdnn" function from here after downloading the original package. kdnn finds k nearest neighbors for a given d dimensional point.