How to check if matlab toolbox installed in matlab
I am working on Matlab R2011a student edition. I want to run some demos provided in Matlab which require some toolbox like Embedded Coder and EDA Simulator Link.
I want to check if those toolboxes are installed in my current version of matlab and if yes how can I check if the licenses are valid.
The reference to this link didn't help me: How would one check for installed MATLAB toolboxes in a script/function? because I need at least the sh开发者_如何学运维ort name of those toolboxes like "control" states for "Control System Toolbox" by using the command ver control.
Any suggestion...
To check that the toolbox is installed, use
v = ver;
any(strcmp(toolboxName, {v.Name}))
where toolboxName
is the name of the toolbox you want to check.
To check that the licence is valid, use
license('test', toolboxName)
easily use ver command. it will list all installed toolboxes and their versions. the other way is to check from the start button.
Also you can use the existing function in FileExchange called isToolboxAvailable
. The usage is as follows:
result = isToolboxAvailable('image processing toolbox','error');
you can always check out the main help documentation which generally lists the toolbox. Or if you press "Start" (the Matlab start, not Windows) the list of installed toolboxes will be organised by category
Here is a dirty solution:
try
<funktion from specific toolbox>
<do this if it is available>
catch
<do this if it is not
end
The names of the toolboxes that are returned by the license
function are the same as what is in the license file. The license file will either be on the local PC or on a FLEXlm license server, depending on your environment. On Windows, check in C:\Program Files\MATLAB\R2011a\licenses
for a license file, which is typically named something like license.lic
or network.lic
. Open the file in your favorite editor (notepad will do). If you see text that says SERVER
followed by a hostname, MAC address, and port number, then you're using a network license and you'll have to ask your systems administrator. Otherwise, there should be an INCREMENT
line for each licensed product and the name of the product as used by the license
function is given following the INCREMENT
keyword. If you're on a UNIX or Linux system, you may have to dig around a bit to find the path for the license file (or perhaps someone else can provide this?).
Edit: My MATLAB install is in a non-standard path. Changed instructions to give the default path.
Just in case somebody stumbles upon this in 2022. There are now several built-in add-on utilities to check if add-ons are installed. Notably:
- matlab.addons.installedAddons: Will list all installed add-ons with (long) Name, Version, Identifier (aka short name/hash)
- matlab.addons.isAddonEnabled: To check if a given add-on is enabled
精彩评论