I am currently working on a project that uses MATLAB and MEX files.

I frequently make changes to the MEX source files for testing, and then go to replace these files with my newly-compiled ones.

However, Windows refuses to replace these files, as MATLAB currently has them "open", despite having quit the debugging process.

So my only option has been to completely close the MATLAB application, copy/replace the MEX files, and then re-open MATLAB.

This is a pain. Any way around it?


Apparently running:

clear all

After quitting the debugging session each time works. I got it mixed up and thought fclose('all') was required, but that apparently is unnecessary.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.