Activate license checkout from script/command
14 次查看(过去 30 天)
显示 更早的评论
Is there anyway to enable license checkout from a command instead of via: Help -> Licensing -> Borrow License.
Once enabled with Borrow Product Licenses Automatically a simple script can check out the needed features
featureStr = {'Aerospace_Blockset'; ...
'Aerospace_Toolbox'; ...
'Bioinformatics_Toolbox'; ...
'Communication_Blocks'; ...
'Communication_Toolbox'; ...
'Compiler'};
index = cellfun(@(f) license('checkout', f), availableFeatures);
checkedOutFeatures = availableFeatures(logical(index));
However, there is still the initial manual step (which can be forgotten). This is an issue for long simulation (20h+) and working via VPN since a refresh of VPN connection will result in inability for matlab.exe to periodically validate against the license server and terminate these long simulation.
Being able to add a couple of commands at the start of a configuration.m to initiate a borrow+features is the safest way to ensure contiguous simulation
0 个评论
回答(1 个)
Simar
2023-10-5
编辑:Simar
2023-10-5
Hi Jonathan,
I understand that you are looking for a way to enable automatic license borrowing via a command or script in MATLAB, rather than manually through the GUI.
Unfortunately, Programmatic borrowing of licenses is limited. The license borrowing process is designed to be initiated manually through the MATLAB interface. This is because borrowing a license is a significant action that can affect other users' ability to use the software, so it is not something that should be done lightly or automatically.
However, one can automate the license checkout process for specific toolboxes using the “license('checkout', feature)” command, as showed in your script. This will ensure that the necessary licenses are checked out before long-running simulations begin.
If MATLAB sessions are being terminated due to VPN disconnections, you might want to consider other solutions. For example, run your MATLAB sessions on a machine that has a direct (non-VPN) connection to the license server. Alternatively, work with your IT Admin to enable uninterrupted VPN settings to avoid undesired disconnects.
Hope it helps!
Best Regards,
Simar
0 个评论
另请参阅
类别
在 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!