MATLAB: Is it possible to specify the destination directory for the mex.file generated from Stateflow when running the model in MATLAB 7.8 (R2009a)

destinationfolderstateflow

I am using Stateflow. The mex.file generated during the simulation of my model is placed inside my current working directory. Is it possible to redirect the output of the mex generation and build steps to be some other place than the current working directory?

Best Answer

This enhancement has been incorporated in Release 2011a (R2011a). For previous product releases, read below for any possible workarounds:
The ability to redirect the output of the mex generation and build steps to be some other place than the current working directory is not available in Stateflow 7.3 (R2009a).
To workaround this issue, you can temporarily change the current directory programmatically using 'cd' command, simulate the model, and change the current directory back to original directory.