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

4 views (last 30 days)
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 :)

Answers (1)

Amal Raj
Amal Raj on 20 Mar 2023
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.

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!