www.gusucode.com > matlab编程隐马尔科夫模型进行未来天气的预测源码程序 > matlab编程隐马尔科夫模型进行未来天气的预测源码程序/MenuControl.m

    function varargout = MenuControl(varargin)
% MENUCONTROL MATLAB code for MenuControl.fig
%      MENUCONTROL, by itself, creates a new MENUCONTROL or raises the existing
%      singleton*.
%
%      H = MENUCONTROL returns the handle to a new MENUCONTROL or the handle to
%      the existing singleton*.
%
%      MENUCONTROL('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in MENUCONTROL.M with the given input arguments.
%
%      MENUCONTROL('Property','Value',...) creates a new MENUCONTROL or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before MenuControl_OpeningFcn gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to MenuControl_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 MenuControl

% Last Modified by GUIDE v2.5 27-Apr-2017 18:10:02

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @MenuControl_OpeningFcn, ...
                   'gui_OutputFcn',  @MenuControl_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
% End initialization code - DO NOT EDIT


% --- Executes just before MenuControl is made visible.
function MenuControl_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 MenuControl (see VARARGIN)

% Choose default command line output for MenuControl
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes MenuControl wait for user response (see UIRESUME)
% uiwait(handles.figure1);


% --- Outputs from this function are returned to the command line.
function varargout = MenuControl_OutputFcn(hObject, eventdata, handles) 
% varargout  cell array for returning output args (see VARARGOUT);
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure
varargout{1} = handles.output;


% --------------------------------------------------------------------
function Untitled_1_Callback(hObject, eventdata, handles)
% hObject    handle to Untitled_1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --------------------------------------------------------------------
function xinx_Callback(hObject, eventdata, handles)
% hObject    handle to xinx (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
x=0:0.01:2*pi;
y=sin(x);
axes(handles.axes1)
h=plot(x,y);
handles.h=h;
guidata(hObject,handles)


% --------------------------------------------------------------------
function cosx_Callback(hObject, eventdata, handles)
% hObject    handle to cosx (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
x=0:0.01:2*pi;
y=cos(x);
axes(handles.axes1)
h=plot(x,y);
handles.h=h;
guidata(hObject,handles)


% --------------------------------------------------------------------
function color_Callback(hObject, eventdata, handles)
% hObject    handle to color (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --------------------------------------------------------------------
function linewidth_Callback(hObject, eventdata, handles)
% hObject    handle to linewidth (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --------------------------------------------------------------------
function linewidth_1_Callback(hObject, eventdata, handles)
% hObject    handle to linewidth_1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
set(handles.h,'LineWidth',1)

% --------------------------------------------------------------------
function linewidth_2_Callback(hObject, eventdata, handles)
% hObject    handle to linewidth_2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
set(handles.h,'LineWidth',2)

% --------------------------------------------------------------------
function linewidth_3_Callback(hObject, eventdata, handles)
% hObject    handle to linewidth_3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
set(handles.h,'LineWidth',3)

% --------------------------------------------------------------------
function red_Callback(hObject, eventdata, handles)
% hObject    handle to red (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
set(handles.h,'color','r')


% --------------------------------------------------------------------
function green_Callback(hObject, eventdata, handles)
% hObject    handle to green (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
set(handles.h,'color','g')

% --------------------------------------------------------------------
function black_Callback(hObject, eventdata, handles)
% hObject    handle to black (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
set(handles.h,'color','b')

% --------------------------------------------------------------------
function line_Callback(hObject, eventdata, handles)
% hObject    handle to line (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)