function varargout = Gui_Main(varargin) % GUI_MAIN MATLAB code for Gui_Main.fig % GUI_MAIN, by itself, creates a new GUI_MAIN or raises the existing % singleton*. % % H = GUI_MAIN returns the handle to a new GUI_MAIN or the handle to % the existing singleton*. % % GUI_MAIN('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in GUI_MAIN.M with the given input arguments. % % GUI_MAIN('Property','Value',...) creates a new GUI_MAIN or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before Gui_Main_OpeningFcn gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to Gui_Main_OpeningFcn via varargin. % % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one % instance to run (singleton)". % % See also: GUIDE, GUIDATA, GUIHANDLES % Edit the above text to modify the response to help Gui_Main % Last Modified by GUIDE v2.5 20-Apr-2011 14:40:49 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @Gui_Main_OpeningFcn, ... 'gui_OutputFcn', @Gui_Main_OutputFcn, ... 'gui_LayoutFcn', [] , ... 'gui_Callback', []); if nargin && ischar(varargin{1}) gui_State.gui_Callback = str2func(varargin{1}); end if nargout [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); else gui_mainfcn(gui_State, varargin{:}); end
时间: 2024-04-27 07:24:49 浏览: 125
GUI数据传递总结
这是一个MATLAB GUI程序的主函数,它定义了GUI的一些属性和回调函数。
具体功能:
1. 定义了一个结构体gui_State,用于存储GUI的属性和回调函数。
2. 如果有输入参数且第一个参数是字符类型,则将该参数作为回调函数名,并设置gui_State.gui_Callback为该回调函数。
3. 调用MATLAB的gui_mainfcn函数,创建GUI界面。
该函数根据输入参数的不同,可能会有输出参数。如果有输出参数,则返回gui_mainfcn函数的输出参数。
阅读全文