annotate rDiff/src/locfit/m/lfgui.m @ 0:0f80a5141704

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