In matlab it is possible to write matlab objects, or even the entire workspace, to a file using the matlab save() call. I would like to intercept the bytestream and postproc
For HG objects, you can intercept the save processing via the internal (modifiable) *.m files that are explained here:
http://undocumentedmatlab.com/blog/handle2struct-struct2handle-and-matlab-8/