Image 使用uigetfile的输出读取图像
如何将图像存储到使用Image 使用uigetfile的输出读取图像,image,matlab,Image,Matlab,如何将图像存储到使用uigetfile()命令检索的变量(例如I)中? 例如, 我选择的图像通过 [FileName PathName] = uigetfile('E:\*.jpg','Select an image'); 现在我想将所选图像存储在变量I中。使用命令imread if ~isequal(FileName,0) I = imread(fullfile(PathName,FileName)); end isequal用于测试用户取消单击。以下代码适用于您:-
uigetfile()
命令检索的变量(例如I
)中?
例如,
我选择的图像通过
[FileName PathName] = uigetfile('E:\*.jpg','Select an image');
现在我想将所选图像存储在变量I中。使用命令
imread
if ~isequal(FileName,0)
I = imread(fullfile(PathName,FileName));
end
isequal
用于测试用户取消单击。以下代码适用于您:-
[FileName,PathName] = uigetfile('*.jpg','Select an image');
image=imread(strcat(PathName,FileName));
我有以下错误???“char”类型的输入参数的未定义函数或方法“equal”。谢谢DAVID。。。成功了……)