check Matlab tlbxs availabe and license
4 次查看(过去 30 天)
显示 更早的评论
As mentioned and recommended in the https://stackoverflow.com/a/2061547/15905792
One drawback to the ver function is that it only tells you what's installed, not what has an available license. It's possible to have a toolbox installed and no license to use it (or all the available licenses could be checked out by other users). A better choice is the license function, which (as you pointed out) requires a unique "feature string" for each toolbox.
The following code checks for licenses for the entire list above:
index = cellfun(@(f) license('test', f), featureStr);
availableFeatures = featureStr(logical(index));
and
index = cellfun(@(f) license('checkout', f), availableFeatures);
checkedOutFeatures = availableFeatures(logical(index));
Unrecognized function or variable 'featureStr'.
Unrecognized function or variable 'availableFeatures'.
How to correctly check available toolboxes and its available licenes?
0 个评论
回答(1 个)
Fangjun Jiang
2025-3-7
featureStr={'MATLAB','Simulink'}
index = cellfun(@(f) license('test', f), featureStr)
availableFeatures = featureStr(logical(index))
2 个评论
Fangjun Jiang
2025-3-10
编辑:Fangjun Jiang
2025-3-11
There is a function getFeatureName(fullname) in this thread. I tried it and it worked well.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!