Matlab 如何将图像加载到轴

Matlab 如何将图像加载到轴,matlab,matlab-guide,Matlab,Matlab Guide,当我按下MatlabGUI中的按钮时,我想将图像从特定文件夹加载到轴上。我已经试过这个代码,它让我选择我想要的图片,但它不加载到轴。有人能帮我吗 [File_Name, Path_Name] = uigetfile() fullImageFileName = fullfile(Path_Name, File_Name); Selected_Image = imread(fullImageFileName ); imshow([Selected_Image ,handles.axes1]) 改用

当我按下MatlabGUI中的按钮时,我想将图像从特定文件夹加载到轴上。我已经试过这个代码,它让我选择我想要的图片,但它不加载到轴。有人能帮我吗

[File_Name, Path_Name] = uigetfile()
fullImageFileName = fullfile(Path_Name, File_Name);
Selected_Image = imread(fullImageFileName );
imshow([Selected_Image ,handles.axes1])

改用
imagesc
:确保在使用任何打印功能之前正确设置了当前轴。我怀疑这段代码不会导致错误,因为它会将图像加载到其他轴上。底线:在
imshow
\
imagesc
do
set(hfig,'CurrentAxes',hAx)之前