如何将图像存储到使用I
命令检索的变量(例如uigetfile()
)中?
例如,
我通过选择图片
[FileName PathName] = uigetfile('E:\*.jpg','Select an image');
现在,我要将所选图像存储在变量I中。
最佳答案
以下代码将为您工作:-
[FileName,PathName] = uigetfile('*.jpg','Select an image');
image=imread(strcat(PathName,FileName));