就是我想放入两张图片,一打开界面就会显示的,然后第一张我是放在了OpeningFcn代码的后面,第一个AXes倒是显示出来了,但是第二个我放在后面就不行,提示有错误。但是不知道为什么图片却有。
function jiemian1_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to jiemian1 (see VARARGIN)
% Choose default command line output for jiemian1
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes jiemian1 wait for user response (see UIRESUME)
% uiwait(handles.figure1);
im=imread('xiaoming.png');
axes(handles.axes2);
imshow(im);
a=imread('biao.png');%就这三行说有问题
axes(handles.axes3);
imshow(a);
运行结果:
??? Reference to non-existent field 'axes3'.
Error in ==> jiemian1>jiemian1_OpeningFcn at 69
axes(handles.axes3);
Error in ==> gui_mainfcn at 153
feval(gui_State.gui_OpeningFcn, gui_hFigure, [], guidata(gui_hFigure), varargin{:});
Error in ==> jiemian1 at 44
gui_mainfcn(gui_State, varargin{:});