Hello, i have a Problem with running a standalone App from Matlabs AppDesigner.
I can build a standalone App with Matlabs Application Compiler with some Warnings that several files/functions have been "excluded from packaging for the "MCR" target environment according to the "Compiler" license". (which are functions we don't have in our code)
I can install the standalone App but while trying to run it it shows the Error- Message:
"Unrecognized function or variable 'matlab.internal.getSettingsRoot'... Error at Line 721"
The responsible part of my code is one the AppDesigner generates by itself:
% Construct app
function app = App_Name(varargin)
% Create UIFigure and components
createComponents(app) % Line 721
% Register the app with App Designer
registerApp(app, app.AppFigure)
% Execute the startup function
runStartupFcn(app, @(app)startupFcn(app, varargin{:}))
if nargout == 0
clear app
end
end
I know how to edit this part but i don't know what i should write instead so that my app works.
Thanks in advance for your help.

 採用された回答

Barbara Kammerl
Barbara Kammerl 2021 年 12 月 13 日

0 投票

I got it to work. After getting the reinstalling MatLab with the latest installation and the latest Version of the Application Compiler it now compiles without warnings and starts without any error. Perhaps my MatLab and Application Compiler Versions didn't match.
Thanks for the help!

その他の回答 (1 件)

Anshika Chourasia
Anshika Chourasia 2021 年 12 月 2 日

1 投票

Hi Barbara,
According to my understanding the issue is very likely to be caused by a corrupt pathdef.m file on your MATLAB search path.
To check where this corrupt file is based, please perform the steps below.
1. Type the following commands in the MATLAB Command Window
p = path
save('my_path')
These commands will save your MATLAB path as a backup
2. Close MATLAB
3. Start MATLAB from the folder <matlabroot>\toolbox\local.
Note that the <matlabroot> part is dependent on your specific machine. To obtain the full path of <matlabroot>, type matlabroot in the MATLAB Command Window.
4. Type the following commands in the MATLAB Command Window
restoredefaultpath
savepath
5. Check whether you can start MATLAB without any error message now
If the error persists, check whether a file called "pathdef.m" exists which is not the one in <matlabroot>\toolbox\local. You can check this by executing the command:
which -all pathdef
If this file exists, please remove it from the MATLAB search path.

3 件のコメント

Barbara Kammerl
Barbara Kammerl 2021 年 12 月 2 日
Sorry I propably didn't specify this properly in my question above but the error doesn't occur when i start Matlab itself but when i try to open the .exe file created by the Application Compiler of my program.
For further clarification: I tried to create the .exe-File by creating a Standalone Desktop App (AppDesigner -> Designer -> Share -> Standalone Desktop App) and having the Runtime included in the package that results in my .exe App. Clicking on "Package" a few warnings appear (see second paragraph above) but otherwise everything works fine. I can install my Standalone App but when trying to open it the Error message above occurs.
The .exe-File should run weather i have matlab installed or not. It shouldn't even try to start matlab as far as i understood. I'm not shure what the pathdef.m file has to do with this. Could you perhaps explain?
Anshika Chourasia
Anshika Chourasia 2021 年 12 月 8 日
It seems to me that it's related to MATLAB standalone compiler settings which internally causing 'matlab.internal.getSettingsRoot' error. Have you tried the above workaround?
Barbara Kammerl
Barbara Kammerl 2021 年 12 月 9 日
I have tried your workaround above and checked to see that i now only have the required pathdef File (in <matlabroot>\toolbox\local) left. I then tried to compile my program again, which resulted in less warnings during the process but after installing the standalone app i got the same error again.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeGet Started with MATLAB Compiler についてさらに検索

製品

リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by