problem with uigetdir in uploading files from it .

1 view (last 30 days)
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'.

Accepted Answer

Image Analyst
Image Analyst on 28 May 2013
filePattern = fullfile(c1, '*.jpg');
srcFiles = dir(filePattern);
  2 Comments
Siddharth
Siddharth on 28 May 2013
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 on 28 May 2013
i rectified it using the link u sent me. Its working. Thanks.

Sign in to comment.

More Answers (0)

Categories

Find more on File Operations in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!