I have a Mex function, say myfunction.mexmaci64 (which is the correct ending on OS X).
Now my function is linked to the mylibrary.dylib library. Both mex file and library are in the same folder.
Now, when I change something in mylibrary , MATLAB does not reload the new version of the library, but instead uses the old one until I restart MATLAB. This is very unpleasant when you are working on development and debugging. Is there any way to get MATLAB to reload the library without restarting the application?
Note. It would be easy to link the library statically with the mex function. However, since I am linking the same library to multiple mex file files, I would prefer to keep my single shared library to reduce compilation time and data redundancy.
Edit:
As for the discussion, clear mex helps:
[~, loaded_mexes] = inmem('-completenames'); % get canonica
returns a list with all downloaded mex files. This list does not contain a linked library, but only mex files. Using clear mex successfully empties this list, but does not mylibrary - re-executing the mex function still gives the same result as with the old shared library.
Thilo source share