Errors in executable file which is created from AppDesigner .

조회 수: 51 (최근 30일)
Kaustubh hike
Kaustubh hike 2021년 9월 1일
답변: Stefanie Schwarz 2024년 4월 17일 10:22
Hi,
I have created one app which takes input as a path and if you press the button it loads specific .mat file from that path.
This is how app looks like
When I run .exe / standalone app , it gives following error in cmd.
'Error using matlabpath
Modifying the search path is not supported by MATLAB Compiler. Remove functions that modify the search path from your MATLAB code. To make files visible to your deployed application, add the parent folder to your MATLAB session.'
How to get ride of this issue ? or is it not possible in standalone app ?
this is how main part of code look like
  댓글 수: 1
Matt J
Matt J 2021년 9월 1일
편집: Matt J 2021년 9월 1일
Please don't include code in your posts as an embedded image. Post the code in a code well, e.g.,
a=1;
b=2;
c=a+b

댓글을 달려면 로그인하십시오.

채택된 답변

Gopinath Karuppannan
Gopinath Karuppannan 2021년 9월 1일
편집: Gopinath Karuppannan 2021년 9월 1일
Hi
You should not use the 'addpath' command (static) while creating the standalone executable file. Instead you can the get the directry information using uigetdir() as a dynamic. It avoids the error.
  댓글 수: 2
Kaustubh hike
Kaustubh hike 2021년 9월 1일
Thanks Gopinath .
Then how can I use uigetdir() to change the working dictionary to that path ?
Goal Is : I want to load specific .mat file which is there at that path location
Gopinath Karuppannan
Gopinath Karuppannan 2021년 9월 1일
uigetdir() --> it allows the user to select the working directory and return the path of the folder. So you can save the path in variable.[link:https://in.mathworks.com/help/matlab/ref/uigetdir.html]. Refer the following example:
pathname = uigetdir();
dir(fullfile(pathname,'*.mat'));
Hope it helps.

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

Matt J
Matt J 2021년 9월 1일
Remove this line from your code
addpath(direct)
It's not doing anything anyway.

Stefanie Schwarz
Stefanie Schwarz 2024년 4월 17일 10:22

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by