MATLAB: Does the previous work folders and other unrelated files get added into the compiled application in MATLAB 7.6 (R2008a) running on Windows Vista

MATLAB Builder for COM

I am using the DEPLOYTOOL interface to create a generic COM Component. For this I have a single MATLAB file that I drag into the newly created project. After compiling and packaging the application, when I extract the CTF, I can see a bunch of unrelated folders that includes MATLAB files of my previous applications and some MATLAB example files (magicsquare.m) that I had not included in the project.

Best Answer

The reason why the previous work folders are getting added into the CTF of the newly created application is that the folders exist in the preferences directory of MATLAB. You can get the path to the preferences directory by typing:
prefdir
at the MATLAB command prompt.
The Preferences for MATLAB and related products (matlab.prf) contains Command history file (history.m), MATLAB shortcuts (shortcuts.xml), MATLAB desktop layout files (MATLABDesktop.xml and Your_Saved_LayoutMATLABLayout.xml) and other related files. This directory is read by MATLAB while starting up or while creating a compiled application.
You can resolve this issue by deleting the preferences directory and restart MATLAB. The preferences directory will get recreated when MATLAB boots up. You can now recompile your application.