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 日

0 投票

Hey, friend,
Using uigetfile is a nice choice, for example
[file,path,indx] = uigetfile( ...
{'*.jpg;*.png;*.tiff;*.tif;*.bmp',...
'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 日

0 投票

% read
[filename, pathname, ~] = uigetfile( ...
{ '*.bmp;*.jpg;*.tif;*.png;*.gif','All Image Files';...
'*.*', 'all files (*.*)'}, ...
'choose file', ...
'MultiSelect', 'off', ...
'C:\Users\Administrator\Desktop\');
filePath = 0;
if isequal(filename, 0) || isequal(pathname, 0)
return;
end
filePath = fullfile(pathname, filename)

カテゴリ

ヘルプ センター および File ExchangeImage Processing Toolbox についてさらに検索

製品

質問済み:

2021 年 11 月 29 日

回答済み:

2021 年 11 月 30 日

Community Treasure Hunt

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

Start Hunting!

Translated by