Azzera filtri
Azzera filtri

Selecting an image folder in App designer

1 visualizzazione (ultimi 30 giorni)
Sujith Roy
Sujith Roy il 13 Nov 2018
Modificato: Cris LaPierre il 13 Nov 2018
Hi All,,
I'm trying to onvert my gui from GUIDE to APP designer. I used the migration tool to do this.
I have a button that selects all the image from a folder when it is selected. This was working well in GUIDE but doesnt work after being converted.
Here is my code. Thanks in advance :)
GUIDE : - Works fine
function SELECT_FOLDER_Callback(hObject, eventdata, handles)
% hObject handle to SELECT_FOLDER (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
try
folder_path = uigetdir('../Input To GUI');
path_details.input_folder = folder_path;
[count_curvature,count_normal,count_images,im_names,im_names_ext] = InputPathDetails(folder_path);
path_details.count_images = count_images;
catch
% errordlg('Please select an image folder','Error');
return
APP DESIGNER: - Only catch statement is executing
function SELECT_FOLDER_Callback(app, event)
% hObject handle to SELECT_FOLDER (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
try
folder_path = uigetdir('../Input To GUI');
path_details.input_folder = folder_path;
[count_curvature,count_normal,count_images,im_names,im_names_ext] = InputPathDetails(folder_path);
path_details.count_images = count_images;
catch
% errordlg('Please select an image folder','Error');
return
end
  1 Commento
Cris LaPierre
Cris LaPierre il 13 Nov 2018
Modificato: Cris LaPierre il 13 Nov 2018
I need to ask a couple clarifying questions.
Where is your structure path_details coming from?
What does InputPathDetails do? It appears to be a function called in your code but not included. It could be an error inside that function that is cauing the code to jump to the catch statement.

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Migrate GUIDE Apps in Help Center e File Exchange

Prodotti


Release

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by