[fname,pname,index]=uigetfile({'*.jpg';'*.bmp'},'选择图片');
if index
str=[pname fname];
c=imread(str);
axes(handles.axes1)
image(c);
axis off
end
if index
str=[pname fname];
c=imread(str);
axes(handles.axes1)
image(c);
axis off
end
本文介绍如何使用Matlab的uigetfile对话框让用户选择一张图片,并将该图片读取到Matlab环境中进行显示。通过代码示例,读者可以了解到具体的实现步骤。
4116
5万+
490
2675

被折叠的 条评论
为什么被折叠?