Programmatically Disable a Toolbox
Show older comments
I have an external toolbox (created by me) and I want to disable it (not uninstall it), do some stuff, and then re-enable it.
I have looked through the available methods in matlab.addons.toolbox, but I only see options for installing and uninstalling.
Looking at other ideas, removing the paths would be a way to disable the toolbox, but how do I know (programatically) what paths to remove? Looking in the Add-Ons explorer I can see the paths associated with the toolbox and I have an option to diasble it, but I can't get either of those through the matlab.addons.toolbox API.
I think I either need a way to get the paths for the toolbox, or I need a method that allows me to disable it.
Am I missing something that exists today to do this?
Accepted Answer
More Answers (1)
Image Analyst
on 15 May 2024
0 votes
Another way is you could remove the toolbox folder(s) from the path with rmpath
3 Comments
Matt Butts
on 15 May 2024
Image Analyst
on 15 May 2024
Use the path variable in your code:
mp = path % store the MATLAB path in variable mp.
% Then search it to find and remove the toolbox folders.
% Stick new path back into path
path = savepath(mp)
Finding the folders and deleting them from the variable is probably more complicated than the other solution given to you.
Matt Butts
on 15 May 2024
Categories
Find more on Introduction to Installation and Licensing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!