Uigetfile Does Not Open A File In Standalone Application R2020a

조회 수: 4 (최근 30일)
Kris Hoffman
Kris Hoffman 2020년 5월 29일
답변: Kris Hoffman 2020년 5월 31일
I'm using the following line to load a file into my application.
[app.name,~ ] = uigetfile({'*.mp4;*.m4v;*.mov'},'Pick a video file','MultiSelect','off');
I've also tried
[app.name,app.path ] = uigetfile({'*.mp4;*.m4v;*.mov'},'Pick a video file','MultiSelect','off');
On OSX (High Sierra)
1.) I compiled the application on R2020a and included the MCR with the compiled application.
2.) The entire application output folder structure is then put onto an external HDD
3.) The entire folder structure is put into the "Documents" folder on another OSX (High Sierra) computer with no Matlab on it.
4.) The MCR is installed on the Matlab-less computer.
5.) The application is run after the MCR is installed.
6.) I click a browse button on the application which includes the above code.
7.) I choose a file to open (any size file). Dialog box closes.
8.) Nothing happens. (Activity monitor shows 25% CPU utilization for a few seconds then nothing)
I'm trying to be explicitly clear as to how to reproduce the problem. I've looked through the documentation included when the app is compiled and countless forums online, and I still cannot find an answer. I've "created a log file", but like many others, I cannot find it.
  댓글 수: 1
dpb
dpb 2020년 5월 30일
편집: dpb 2020년 5월 30일
uigetfile never actually loads a file; it only returns the file name and optionally the path the user selected from the dialog opened.
It's the application's job then to use the appropriate function to actually open the data file.
You've coded the first part, now must take the next steps...

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

채택된 답변

Kris Hoffman
Kris Hoffman 2020년 5월 31일
I figured it out. Of course right after I posted this question haha.
True, yes, uigetfile does nothing but get the file name and or path to the file(s). I did have a load command later on in the script
load(app.name)
However, I took for granted that the files always loaded in the IDE because it was always in the correct directory (where the videos were). All I needed to add was...
cd(app.path)
right after the uigetfile and everything was fine.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by