Since there is no finally clause to the try-catch block in MATLAB, I find myself writing lots of code like the following:
fid = fopen(filename); if fid==-1
My preference is to create a FileHandle class with a delete method that closes the file when the object goes out of scope. Also gives you the opportunity to do other more natural file handle-y things.
FileHandle
delete