how to select image from a particular folder

2 views (last 30 days)
i wanted to select an image from a folder named dataset....
[filename pathname]=uigetfile('*.tif','Select An Image');
when i do so, i have to select the Dataset folder and then the image from it.... what shud i do so that on execution itself the images will be displayed so that i neednt select on Dataset folder and then images

Accepted Answer

Walter Roberson
Walter Roberson on 13 Mar 2013
Read the documentation.
FilterSpec can include a path. That path can contain '.','..', \, '/', or '~'. For example, '../*.m' lists all code files in the folder above the current folder.
  9 Comments
Walter Roberson
Walter Roberson on 13 Mar 2013
You can search your entire filesystem to try to find ProjectWork
Or, you can answer my earlier question "What directory are you cd'd to at the time you run the uigetfile() "
Image Analyst
Image Analyst on 13 Mar 2013
What I do in that case (the folder you were expecting, say the folder you used last time you ran the program, cannot be found) is to bring up a file browse dialog box, like uigetdir() or uipickfiles, and have the user locate it.

Sign in to comment.

More Answers (1)

Said Akram Anwarzai
Said Akram Anwarzai on 24 Apr 2020
[filename pathname]=uigetfile('*.tif','Select An Image');

Categories

Find more on Images 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!