程序所用图片
1.首先创建如图所示的GUI
注:所有的控件的Units值都得设置为pixels
2.打开对应的.m文件,找到OpeningFcn回调函数下
% --- Executes justbefore untitled is made
visible.
function untitled_OpeningFcn(hObject,
eventdata, handles, varargin)
% This function has nooutput args, see
OutputFcn.
%
hObject
handle to figure
% eventdata reserved - to be defined in
a future versionof MATLAB
%
handles
structure with handles and user data (seeGUIDATA)
% varargin command
line arguments to untitled (seeVARARGIN)
% Choose default commandline output for
untitled
handles.output = hObject;
set(handles.figure1,'units','pixels',.