资源描述:
《matlab图像去噪程序.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、functionvarargout=jiemian(varargin)%返回从函数jiemian.m中得到的参数中变量的数目;传递一个参数中变量的数目给函数jiemian.m。%JIEMIANApplicationM-fileforjiemian.fig%FIG=JIEMIANlaunchjiemianGUI.%JIEMIAN('callback_name',...)invokethenamedcallback.%LastModifiedbyshijiaweiv2.524-May-201402:45:18ifnargin==0%LAUNCHGUI%nargin显示输入变量fig=
2、openfig(mfilename,'reuse');%打开包含在FIG文件filename.fig中的图形,确保它是可见的并且完全定位在屏幕上。%Generateastructureofhandlestopasstocallbacks,andstoreit.handles=guihandles(fig);%返回一个结构,它包含图像中对象的句柄guidata(fig,handles);%将变量handles存储到fig文件中ifnargout>0%如果输出变量大于0varargout{1}=fig;%返回figendelseifischar(varargin{1})%INVOKE
3、NAMEDSUBFUNCTIONORCALLBACK%如果varargin{1}是一个字符数组则返回逻辑真(1),否则返回逻辑假(0)。tryif(nargout)%显示用户提供的输出变量的个数[varargout{1:nargout}]=feval(varargin{:});%FEVALswitchyard%varargout传递参数中的变量数目elsefeval(varargin{:});%FEVALswitchyard%**feval函数的求值endcatch%如果出错开始执行catch块disp(lasterr);%%%%lasterr函数查询出错原因。如果函数laste
4、rr的运行结果为一个空串,则表明组命令1被成功执行了%%%%disp显示矩阵和文字内容endend%
5、ABOUTCALLBACKS:%
6、GUIDEautomaticallyappendssubfunctionprototypestothisfile,and%
7、setsobjects'callbackpropertiestocallthemthroughtheFEVAL%
8、switchyardabove.Thiscommentdescribesthatmechanism.%
9、%
10、Eachcallbacksubfunctiondeclarationhasthefollowingfor
11、m:%
12、(H,EVENTDATA,HANDLES,VARARGIN)%
13、%
14、Thesubfunctionnameiscomposedusingtheobject'sTagandthe%
15、callbacktypeseparatedby'_',e.g.'slider2_Callback',%
16、'figure1_CloseRequestFcn','axis1_ButtondownFcn'.%
17、%
18、Histhecallbackobject'shandle(obtainedusingGCBO).%
19、%
20、EVENTDATAisempty,butreserv
21、edforfutureuse.%
22、%
23、HANDLESisastructurecontaininghandlesofcomponentsinGUIusing%
24、tagsasfieldnames,e.g.handles.figure1,handles.slider2.This%
25、structureiscreatedatGUIstartupusingGUIHANDLESandstoredin%
26、thefigure'sapplicationdatausingGUIDATA.Acopyofthestructure%
27、ispassedtoeachcallback.Youcanstoreadd
28、itionalinformationin%
29、thisstructureatGUIstartup,andyoucanchangethestructure%
30、duringcallbacks.Callguidata(h,handles)afterchangingyour%
31、copytoreplacethestoredoriginalsothatsubsequentcallbackssee%
32、theupdates.Type"helpguihandles"and"helpguidata"f