code to choose an image from a folder

1 view (last 30 days)
hello i tried the following code
path = 'c:\users\userName\my documents\matlab';
filter = '*.bmp';
selectedFile = uigetfile(fullfile(path , filter));
imshow(selectedFile)
iam not able to display the image. please help.
thank you

Accepted Answer

Chad Greene
Chad Greene on 15 Mar 2017
Try
I = imread(selectedFile);
imshow(I)

More Answers (0)

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!