How would one check for installed MATLAB toolboxes in a script/function? (checking toolbox versions would also be good!) This could provide a quick and useful error message when someone attempts to run a script without a required toolbox.
A quick, albeit rough, solution that comes to mind is parsing the text output of the ver command. I wonder if there's a better way.
Some quick searching revealed ver product or the license function with the 'test' argument may be useful, but I could not find a mapping of toolbox names (ie. 'Image Processing Toolbox') to product names (ie. 'control') or feature names (ie. image_toolbox).
Furthermore, when I ran license('inuse'), I only received the following:
>> a = license('inuse'); a
a =
feature: 'matlab'
user: <username>
I hoped for a list of the many toolboxes I have access to.
This question was prompted by trying to test a co-workers script early. Unfortunately, it required the Image Processing Toolbox, which I currently lack. A useful error message would've saved time trying to diagnose the problem. Now I'll wait for a compiled version before testing it.