It is possible, and often useful, to make your own external standalone programs act like new MATLAB functions. This can be done by writing M-files that: 1. Save the variables on disk. 2. Run the external programs (which read the data files, process them, and write the results back out to disk). 3. Load the processed files back into the workspace. For example, here is a hypothetical M-function that finds the solution to Garfield's equation using an external program called GAREQN: function y = garfield(a,b,q,r) save gardata a b q r !gareqn load gardata It requires that you have written a program (in Fortran or some other language) called GAREQN that reads a file called gardata.mat, processes it, and puts the results back out to the same file. There are some example programs (C and Fortran) that allow reading and writing Matlab .m files from an external program in the matlab/src directory. See the README file in that directory, plus the source code itself for more details. The full detail is rather lengthy. You are welcome to come to the consulting office (1st floor N42) and look at the manual; it is detailed on page 2-89.