Call a folder from desktop and use images inside it

조회 수: 2(최근 30일)
I want to make a programme where i can call a file from desktop and them use images stored in it in the same programme.

채택된 답변

Wan Ji
Wan Ji 2021년 11월 29일
Hey, friend,
Using uigetfile is a nice choice, for example
[file,path,indx] = uigetfile( ...
'Image Files (*.jpg;*.png;*.tiff;*.tif;*.bmp)'; ...
'*.*','All Files (*.*)'}, ...
'Select a File');
% Then use imread to read the image
I = imread([path, file]);

추가 답변(1개)

yanqi liu
yanqi liu 2021년 11월 30일
% read
[filename, pathname, ~] = uigetfile( ...
{ '*.bmp;*.jpg;*.tif;*.png;*.gif','All Image Files';...
'*.*', 'all files (*.*)'}, ...
'choose file', ...
'MultiSelect', 'off', ...
filePath = 0;
if isequal(filename, 0) || isequal(pathname, 0)
filePath = fullfile(pathname, filename)


Community Treasure Hunt

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

Start Hunting!

Translated by