필터 지우기
필터 지우기

problem with uigetdir in uploading files from it .

조회 수: 2 (최근 30일)
Siddharth
Siddharth 2013년 5월 28일
i created a push button to browse a directory. It works but then I need to upload pics from this directory.
For the browse push button i used:
global c1;
c1=uigetdir;
and for uploading pictures from the directory i used:
global c1;
srcFiles = dir(c1\'*.jpg');
but i get an error saying 'dir is not defined for double inputs'.

채택된 답변

Image Analyst
Image Analyst 2013년 5월 28일
filePattern = fullfile(c1, '*.jpg');
srcFiles = dir(filePattern);
  댓글 수: 2
Siddharth
Siddharth 2013년 5월 28일
thanks. this worked but i am now getting an error when i am trying to display these images using:
filename = strcat(c1,srcFiles(j).name);
I = imread(filename);
imshow(I);
Siddharth
Siddharth 2013년 5월 28일
i rectified it using the link u sent me. Its working. Thanks.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by