解决方案:
% --- Executes on button press in ReadImgButton.
% 选取图片按钮的程序代码
function ReadImgButton_Callback(hObject, eventdata, handles)
global img; % 定义一个全局变量img
% 选择图片路径
[filename, pathname] = ...
uigetfile({'*.bmp';'*.tif';'*.png'},'select picture');
str=[pathname filename]; %合成路径+文件名
img = imread(str); %读取图片
axes(handles.axes1); %使用第一个axes
hold on; %一定要注意加上这个hold on,针对matlab 7.0.1版本
imshow(img); %显示图片
% hObject handle to ReadImgButton (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)