How to install a .mltbx without opening Licence Agreement Screen?

3 ビュー (過去 30 日間)
Luna
Luna 2019 年 3 月 1 日
回答済み: Luna 2019 年 3 月 4 日
Hello dear community!
I want to install GUI Layout Toolbox inside a function with only code. I am currently using 2018a and earlier versions. I have already downloaded both .zip file and .mltbx file from FEX. (version 2.3.4)
I have extracted .zip file and added the codes folder inside my main app folder and added all folders and subfolders into Matlab path with addpath. I runned my app's main function which includes constructGUI.m method which creates a figure and moves the figure center with movegui.
It gave me the error below:
Error using get (line 13)
uiextras.get has been removed.
Error in matlab.ui.internal.legacyMoveGUI (line 88)
old0units = get(0, 'Units');
Error in movegui (line 125)
matlab.ui.internal.legacyMoveGUI(fig, position);
The reason of this error I think is the set.m and get.m functions inside the GUI Layout Toolbox's uiextras folder. Those two contradict with Matlab's built-in set&get methods.
So my question is How can I install it without opening the licence agreement screen? And get rid of the above error?
Here is my code below:
function mainGUI = mainFunc()
addpath([cd,'\','creatorGUI']);
addpath([cd,'\','helperGUI']);
verStruct = ver('layout'); % checks if GUI Layout Toolbox is installed
if isempty(verStruct)
fullToolboxPath = [cd, '\GUI Layout Toolbox 2.3.4.mltbx'];
newAddon = matlab.addons.install(fullToolboxPath,true); % this does not work in 2018a
%% there should be some code here to add gui layout toolbox functions in Add-Ons folder if it exists.
end
% this section detects if my app is already open and if it is not, creates my main GUI.
if isempty(findall(0,'Tag','MainFigure'))
appObj = View.myApp();
mainGUI = appObj.constructGUI;
else
warndlg('App is already open', 'Warning!','modal');
end
end
I really apreciate your help. Thank you very much for your time.

採用された回答

Luna
Luna 2019 年 3 月 4 日
I found a way,
newAddon = matlab.addons.toolbox.installToolbox(fullToolboxPath,true);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by