Check whether a license is available.
조회 수: 161 (최근 30일)
이전 댓글 표시
For testing we run as many matlab instances as possible.
How can we find out that no license is available?
At best without starting matlab.
But if we have to start matlab: what is a save way to check whether a license is available or not?
댓글 수: 0
답변 (1개)
Walter Roberson
2022년 7월 18일
Once you are in MATLAB, to check whether a toolbox license is available, you can use license('test') . For example,
license('test', 'Symbolic_Toolbox')
The names you have to use are not always obvious; I listed as many names as I could find in https://www.mathworks.com/matlabcentral/answers/449314-how-do-features-from-license-correspond-to-names-from-ver?s_tid=srchtitle
If you are using a license manager, then you can look at license usage using lmutil with the lmstats command or possibly using a GUI; see https://sites.math.washington.edu/~reu/codes/Matlab/Matlab%201/jhelp/base/install/pc/ch3_li12.html
댓글 수: 4
Walter Roberson
2022년 7월 22일
I think your comment is still at https://www.mathworks.com/matlabcentral/answers/1763205-check-whether-a-license-is-available#comment_2277655 ? You might need to "Show older comments" to see it.
You cannot use the license() command to test for a MATLAB license until after you have started MATLAB, but you cannot start MATLAB unless there is an available license.
The lmutil lmstat is a utility that is not part of MATLAB, but which can talk to the license server to find out licenses in use. It will not tell you directly how many licenses are available -- you have to look at the line such as
Users of MATLAB: (Total of 5 licenses available)
If you are using Standalone Named User licenses (license resides on host, no license server) and the processes are all being launched by the same username, then it is not clear to me whether the limit applies. In such a situation you could potentially find out how many are already executing using taskmgr (Windows) or ps (MacOS or Linux)
참고 항목
카테고리
Help Center 및 File Exchange에서 Manage Products에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!