MATLAB: Test if toolbox is installed

license

I need to test if the program user has the "Statistics and Machine Learning Toolbox" installed. I'm use to testing licenses using: license('test', 'Simulink') as an example. When I use license('test', 'Statistics_and_Machine_Learning_Toolbox'), however, I receive the following error:
Error using license Feature name must be less than 28 characters.
Error is pretty straightforward, but I'm wondering if anyone has a workaround or another way to test for toolbox installation?
Thanks

Best Answer

The license name is usually one or two words , so for stats, it will still be Statistics_Toolbox
license('test','statistics_toolbox')
Related Question