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
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 Center 및 File Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!