why when i import an image from my desktop the error says it doesnt exist plz help and thank u in advance

 Accepted Answer

Use both output arguments from uigetfile to construct the full path name of the file:
[filename,pathname] = uigetfile();
fullfilename = fullfile(pathname,filename);
a = imread(fullfilename);

2 Comments

Also, we recommend
[filename,pathname] = uigetfile();
if isnumeric(filename); return; end %user cancel
fullfilename = fullfile(pathname,filename);

Sign in to comment.

More Answers (0)

Categories

Find more on Images in Help Center and File Exchange

Tags

Asked:

on 29 Nov 2022

Commented:

on 29 Nov 2022

Community Treasure Hunt

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

Start Hunting!