App Designer return from function if ui directory is closed using uiopen

3 次查看(过去 30 天)
Hi, I've got two functions that saves and loads multiple ui table data. They work fine when files are selcted but for load it throws an error when the ui directory to search for a file/folder is closed/exited. How can I determine that its been closed to return from the function ? Im using uiopen.
(for refernce I did get it to work using save with save(fullfile(Location, name), 'a','b',etc) where location = uigetdir. using if location==0 then return.)
Thanks in advance :)

回答(1 个)

Amal Raj
Amal Raj 2023-3-20
If I understand your question correctly, you want to detect if the directory selected by the user using uiopen has been closed/exited so that you can return from the function.
One approach you can take is to use a try-catch block to catch the error thrown by uiopen when the directory is closed/exited.

类别

Help CenterFile Exchange 中查找有关 Develop uifigure-Based Apps 的更多信息

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by