check Matlab tlbxs availabe and license

조회 수: 4 (최근 30일)
Peter
Peter 2025년 3월 7일
편집: Fangjun Jiang 2025년 3월 11일
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?

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2025년 3월 7일
featureStr={'MATLAB','Simulink'}
featureStr = 1x2 cell array
{'MATLAB'} {'Simulink'}
index = cellfun(@(f) license('test', f), featureStr)
index = 1×2
1 1
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
availableFeatures = featureStr(logical(index))
availableFeatures = 1x2 cell array
{'MATLAB'} {'Simulink'}
  댓글 수: 2
Peter
Peter 2025년 3월 10일
OK. how to get all that up-to-date featureStrings list?
Fangjun Jiang
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 CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

제품


릴리스

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by