It is an easy thing, but came to me just recently. Often when processing results of MCNP or Serpent calculations I was annoyed by necessity to define MATLAB functions in a separate file, even if I don’t use them anywhere else. Well, it has an obvious solution – make the main script as a function (just be careful choosing its name). Then all single-use functions can be located in the same file:

function main_script
clc, clear all, fclose all %, close all
data = process_output_file('~/input.outp') % calling another function
...

function data = process_output_file(path)
...

A drawback of this way is that it requires some additional actions to access/set your global variables. However, when everything is processed in a single file, then there is probably no need to use them. If you do need to access the data outside your main script – try using a structure variable to store all global variables

function main_script
...
global globs
globs.data = 1:3;

and then you are able to access the data anytime after the function has been run:

>> global globs; globs.data

globals = 

    data: [1 2 3]

MATLAB GUI has a special menu item for navigating between functions defined in the current file, and this can be quite handy if you have plenty of them.

Let me know if you have other ideas in this subject!