MATLAB: Am I unable to call UNLOADLIBRARY while an object generated with the LIBSTRUCT command exists in the workspace

calllibdllgenericlibraryMATLAB

I am trying to execute the example code found in the documentation for LIBSTRUCT:
web([docroot,'/techdoc/apiref/libstruct.html'])
This code results in the following error:
??? Error using ==> unloadlibrary
Cannot unload a library that has outstanding objects.

Best Answer

This change has been incorporated into the documentation in Release 14 Service Pack 3 (R14SP3). For previous releases, read below for any additional information:
There is an error in the documentation for LIBSTRUCT. To unload a library, all structures generated by LIBSTRUCT must be cleared from the MATLAB workspace. To work around this issue, clear any LIBSTRUCT objects related to a library before calling UNLOADLIBRARY.