0
|
1 function varargout = lfgui(varargin)
|
|
2 % LFGUI M-file for lfgui.fig
|
|
3 % LFGUI, by itself, creates a new LFGUI or raises the existing
|
|
4 % singleton*.
|
|
5 %
|
|
6 % H = LFGUI returns the handle to a new LFGUI or the handle to
|
|
7 % the existing singleton*.
|
|
8 %
|
|
9 % LFGUI('CALLBACK',hObject,eventData,handles,...) calls the local
|
|
10 % function named CALLBACK in LFGUI.M with the given input arguments.
|
|
11 %
|
|
12 % LFGUI('Property','Value',...) creates a new LFGUI or raises the
|
|
13 % existing singleton*. Starting from the left, property value pairs are
|
|
14 % applied to the GUI before lfgui_OpeningFunction gets called. An
|
|
15 % unrecognized property name or invalid value makes property application
|
|
16 % stop. All inputs are passed to lfgui_OpeningFcn via varargin.
|
|
17 %
|
|
18 % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
|
|
19 % instance to run (singleton)".
|
|
20 %
|
|
21 % See also: GUIDE, GUIDATA, GUIHANDLES
|
|
22
|
|
23 % Copyright 2002-2003 The MathWorks, Inc.
|
|
24
|
|
25 % Edit the above text to modify the response to help lfgui
|
|
26
|
|
27 % Last Modified by GUIDE v2.5 27-Dec-2005 18:56:48
|
|
28
|
|
29 % Begin initialization code - DO NOT EDIT
|
|
30 gui_Singleton = 1;
|
|
31 gui_State = struct('gui_Name', mfilename, ...
|
|
32 'gui_Singleton', gui_Singleton, ...
|
|
33 'gui_OpeningFcn', @lfgui_OpeningFcn, ...
|
|
34 'gui_OutputFcn', @lfgui_OutputFcn, ...
|
|
35 'gui_LayoutFcn', [] , ...
|
|
36 'gui_Callback', []);
|
|
37 if nargin && ischar(varargin{1})
|
|
38 gui_State.gui_Callback = str2func(varargin{1});
|
|
39 end
|
|
40
|
|
41 if nargout
|
|
42 [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
|
|
43 else
|
|
44 gui_mainfcn(gui_State, varargin{:});
|
|
45 end
|
|
46 % End initialization code - DO NOT EDIT
|
|
47
|
|
48
|
|
49 % --- Executes just before lfgui is made visible.
|
|
50 function lfgui_OpeningFcn(hObject, eventdata, handles, varargin)
|
|
51 % This function has no output args, see OutputFcn.
|
|
52 % hObject handle to figure
|
|
53 % eventdata reserved - to be defined in a future version of MATLAB
|
|
54 % handles structure with handles and user data (see GUIDATA)
|
|
55 % varargin command line arguments to lfgui (see VARARGIN)
|
|
56
|
|
57 fit = locfit(varargin{:});
|
|
58 lfplot(fit);
|
|
59 handles.lfargs = varargin;
|
|
60
|
|
61 % Choose default command line output for lfgui
|
|
62 handles.output = hObject;
|
|
63
|
|
64 % Update handles structure
|
|
65 guidata(hObject, handles);
|
|
66
|
|
67 % UIWAIT makes lfgui wait for user response (see UIRESUME)
|
|
68 % uiwait(handles.figure1);
|
|
69
|
|
70
|
|
71 % --- Outputs from this function are returned to the command line.
|
|
72 function varargout = lfgui_OutputFcn(hObject, eventdata, handles)
|
|
73 % varargout cell array for returning output args (see VARARGOUT);
|
|
74 % hObject handle to figure
|
|
75 % eventdata reserved - to be defined in a future version of MATLAB
|
|
76 % handles structure with handles and user data (see GUIDATA)
|
|
77
|
|
78 % Get default command line output from handles structure
|
|
79 varargout{1} = handles.output;
|
|
80
|
|
81
|
|
82 % --- Executes on slider movement.
|
|
83 function slider1_Callback(hObject, eventdata, handles)
|
|
84 % hObject handle to slider1 (see GCBO)
|
|
85 % eventdata reserved - to be defined in a future version of MATLAB
|
|
86 % handles structure with handles and user data (see GUIDATA)
|
|
87
|
|
88 % Hints: get(hObject,'Value') returns position of slider
|
|
89 % get(hObject,'Min') and get(hObject,'Max') to determine range of slider
|
|
90
|
|
91 n = get(hObject,'Value');
|
|
92 n0 = get(hObject,'Min');
|
|
93 n1 = get(hObject,'Max');
|
|
94 nn = 0.1+(n-n0)/(n1-n0);
|
|
95 fit = locfit(handles.lfargs{:},'nn',nn);
|
|
96 lfplot(fit);
|
|
97
|
|
98 % --- Executes during object creation, after setting all properties.
|
|
99 function slider1_CreateFcn(hObject, eventdata, handles)
|
|
100 % hObject handle to slider1 (see GCBO)
|
|
101 % eventdata reserved - to be defined in a future version of MATLAB
|
|
102 % handles empty - handles not created until after all CreateFcns called
|
|
103
|
|
104 % Hint: slider controls usually have a light gray background, change
|
|
105 % 'usewhitebg' to 0 to use default. See ISPC and COMPUTER.
|
|
106 usewhitebg = 1;
|
|
107 if usewhitebg
|
|
108 set(hObject,'BackgroundColor',[.9 .9 .9]);
|
|
109 else
|
|
110 set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
|
|
111 end
|
|
112
|
|
113
|