Selecting an image folder in App designer

1 次查看(过去 30 天)
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 个评论
Cris LaPierre
Cris LaPierre 2018-11-13
编辑:Cris LaPierre 2018-11-13
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.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

标签

产品


版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by