Uigetfile Does Not Open A File In Standalone Application R2020a

5 次查看(过去 30 天)
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 中查找有关 Application Deployment 的更多信息

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by