How can I toggle licenses on and off programmatically for testing?
6 ビュー (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2022 年 8 月 8 日
コメント済み: Walter Roberson
2022 年 11 月 15 日
How can I turn a license on and off for testing so that I can check if my code works for different users who may not have access to a license?
採用された回答
MathWorks Support Team
2022 年 8 月 8 日
The output of the 'license' command can be used to check if you has access to a license or toolbox. Please refer to the link below for more information on the 'license' command.
The 'toggle' input to the 'license' command is useful for testing if your code works whether or not a license exists. The 'license' command will return 0 for a license or toolbox if the 'toggle' input is set to 'disable'. If it is set to 'enable', it will check for the existence of the license as usual.
1 件のコメント
Walter Roberson
2022 年 11 月 15 日
This does not answer the question.
The person asking the question has all appropriate licenses, but they want to test to be sure their code will work properly if the end-user does not have some licenses, so the person asking the question wants to be able to tell MATLAB to turn particular licenses on or off.
Imagine, for example, a unit test framework in which the developer needs to test a function under various conditions.
その他の回答 (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!