% Button pushed function: Button_3
function Button_3Pushed(app, event)
%创建文件选择对话框选择指定图像
[file,path]=uigetfile('*.png')
if isequal(file,0)
disp('User selected Cancel');
else
disp(['User selected ', fullfile(path,file)]);
img=imread(fullfile(path,file));%读取图像
imshow(img,'Parent',app.UIAxes)%将图像显示在指定坐标轴
end
end
matlab app designer创建打开文本框选中图片并显示在指定坐标轴
最新推荐文章于 2024-05-30 20:15:11 发布