This should really be part of Matlab -- it Just Works.
Just a quick shout out: if you want to include object-orientated code in your .zip, by default depfun and "mydepfun" won't find private methods of your objects. This is because they'll never be on your path (by definition) and you'll get errors like "error using depfun > next_arg_file. The file 'privateMethod' does not exist".
The solution to this is to change line 39 of exportToZip to read