Why does the installed support package stop working after restarting MATLAB?

I  installed a support package for MATLAB from the Add-On Manager. It worked flawlessly, and then I closed and re-opened MATLAB. Now I get the error  "Support Package xxx has not been installed. Open Support Package Installer to install the xxx Support Package ."
If I open the Add-On Explorer it's there, marked as "installed".  Any idea what's going on here?

 Accepted Answer

When you install a support package, MATLAB attempts to add the necessary directories to your path. However, if your pathdef.m (path definition file) is read-only, it probably failed to save the updated path. That means the path is active until you restart MATLAB.
Try this:
which -all pathdef
  • If there is only one, it is most likely in your MATLAB installation directory, and it is a read-only file.
  • If you have more than one, check each of them to see whether the path to the support package is included in one and not included in the other. The one that shows up first in the list is the one that is used by MATLAB, so make sure that file includes the necessary paths.
Make sure that your pathdef.m has both read and write permissions. The pathdef.m will need to be updated with the Support Package directories if the Support Package still does not work after restarting MATLAB.
Some troubleshooting steps to try within a MATLAB session where the support package functionality is not working:
  • Check if "restoredefaultpath" is called anywhere in the "startup" and "matlabrc" files, which could be removing the support package directory from the path.
  • Try manually adding the support package directory and subdirectories to the path using "genpath" and "addpath"
>> addpath(genpath(<supportPackageDirectory>)); % Add the support package directory to the path
  • If this does not work, try using "addpath" and "genpath" without any arguments
>> addpath(genpath()); % Add everything in <matlabroot>/toolbox to the path
At any point you can check what support packages are installed using
>> matlabshared.supportpkg.getInstalled

More Answers (0)

Categories

Products

Release

R2016b

Tags

No tags entered yet.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!