How to integrate license file into GUI?
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello, I am developing the GUI for a script. For this I want to have a license time check. For this simple purpose I have created license.m with following function:
function output = license(varargin)
if now > datenum('2017-01-01') % this code stops working Jan 1, 2017
h = msgbox('Please update your License','License Expired') ;
return
end
end
Now I need help in calling this file in my Matlab GUI script. I want to have this check at beginning of the execution.
댓글 수: 0
답변 (1개)
Walter Roberson
2016년 5월 31일
If you are using GUIDE then look in the generated code, and put your call to your license check just before the line
% Begin initialization code - DO NOT EDIT
댓글 수: 5
Image Analyst
2020년 6월 10일
chek_license contains these lines of code:
if now > datenum('2017-01-01') % this code stops working Jan 1, 2017
h = msgbox('Please update your License','License Expired') ;
quit
end
A better way would be this:
% Check that user has the specified Toolbox installed and licensed.
hasLicenseForToolbox = license('test', 'matlab'); % Check for base MATLAB.
% hasLicenseForToolbox = license('test', 'Image_Acquisition_Toolbox'); % Check for Image Acquisition Toolbox.
% hasLicenseForToolbox = license('test', 'Statistics_Toolbox'); % Check for Statistics and Machine Learning Toolbox.
% hasLicenseForToolbox = license('test', 'Signal_Toolbox'); % Check for Signal Processing Toolbox.
% hasLicenseForToolbox = license('test', 'Video_and_Image_Blockset'); % Check for Computer Vision System Toolbox.
% hasLicenseForToolbox = license('test', 'Neural_Network_Toolbox'); % Check for Deep Learning Toolbox.
참고 항목
카테고리
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!