put all images of a directory in listbox
조회 수: 2 (최근 30일)
이전 댓글 표시
how can i put all images of a directory in listbox and then select one of them to do image to show in axes
댓글 수: 0
답변 (2개)
Walter Roberson
2014년 1월 20일
will give you information on getting the image names. Once you have them in a cell string array, you can set() the listbox String property to that cell string array.
In the callback for the listbox,
choices = get(hObject, 'String');
selected = get(hObject, 'Value');
thischoice = choices{selected};
댓글 수: 0
David Sanchez
2014년 1월 20일
my_pngs = dir('*.png'); % choose png files from directory
pics_cell = cell(numel(my_pngs),1);
for k=1:numel(my_pngs)
pics_cell{k} = my_pngs(k).name;
end
set(handles.my_list,'String',pics_cell) % my_list is the name of your listbox
댓글 수: 8
참고 항목
카테고리
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!