A example of creating C++ objects dynamically in a MATLAB MEX file that persist between calls.