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

3 Ansichten (letzte 30 Tage)
Paige
Paige am 1 Dez. 2022
Beantwortet: Amal Raj am 20 Mär. 2023
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 :)

Antworten (1)

Amal Raj
Amal Raj am 20 Mär. 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.

Kategorien

Mehr zu Introduction to Installation and Licensing finden Sie in Help Center und File Exchange

Produkte


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by