rbmatlab  1.13.10
 All Classes Namespaces Files Functions Variables Groups Pages
lin_stat_plot_control.m
Go to the documentation of this file.
1 function varargout = lin_stat_plot_control(varargin)
2 % LIN_STAT_PLOT_CONTROL M-file for lin_stat_plot_control.fig
3 % LIN_STAT_PLOT_CONTROL, by itself, creates a new LIN_STAT_PLOT_CONTROL or raises the existing
4 % singleton*.
5 %
6 % H = LIN_STAT_PLOT_CONTROL returns the handle to a new LIN_STAT_PLOT_CONTROL or the handle to
7 % the existing singleton*.
8 %
9 % LIN_STAT_PLOT_CONTROL('CALLBACK',hObject,eventData,handles,...) calls the local
10 % function named CALLBACK in LIN_STAT_PLOT_CONTROL.M with the given input arguments.
11 %
12 % LIN_STAT_PLOT_CONTROL('Property','Value',...) creates a new LIN_STAT_PLOT_CONTROL or raises the
13 % existing singleton*. Starting from the left, property value pairs are
14 % applied to the GUI before lin_stat_plot_control_OpeningFcn gets called. An
15 % unrecognized property name or invalid value makes property application
16 % stop. All inputs are passed to lin_stat_plot_control_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 % Edit the above text to modify the response to help lin_stat_plot_control
24 
25 % Last Modified by GUIDE v2.5 23-Apr-2012 13:48:22
26 
27 % Begin initialization code - DO NOT EDIT
28 gui_Singleton = 1;
29 gui_State = struct('gui_Name', mfilename, ...
30  'gui_Singleton', gui_Singleton, ...
31  'gui_OpeningFcn', @lin_stat_plot_control_OpeningFcn, ...
32  'gui_OutputFcn', @lin_stat_plot_control_OutputFcn, ...
33  'gui_LayoutFcn', [] , ...
34  'gui_Callback', []);
35 if nargin && ischar(varargin{1})
36  gui_State.gui_Callback = str2func(varargin{1});
37 end
38 
39 if nargout
40  [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
41 else
42  gui_mainfcn(gui_State, varargin{:});
43 end
44 % End initialization code - DO NOT EDIT
45 
46 
47 % --- Executes just before lin_stat_plot_control is made visible.
48 function lin_stat_plot_control_OpeningFcn(hObject, eventdata, handles, varargin)
49 % This function has no output args, see OutputFcn.
50 % hObject handle to figure
51 % eventdata reserved - to be defined in a future version of MATLAB
52 % handles structure with handles and user data (see GUIDATA)
53 % varargin command line arguments to lin_stat_plot_control (see VARARGIN)
54 
55 % Choose default command line output for lin_stat_plot_control
56 handles.output = hObject;
57 
58 % Update handles structure
59 guidata(hObject, handles);
60 
61 % UIWAIT makes lin_stat_plot_control wait for user response (see UIRESUME)
62 % uiwait(handles.figure1);
63 
64 
65 % --- Outputs from this function are returned to the command line.
66 function varargout = lin_stat_plot_control_OutputFcn(hObject, eventdata, handles)
67 % varargout cell array for returning output args (see VARARGOUT);
68 % hObject handle to figure
69 % eventdata reserved - to be defined in a future version of MATLAB
70 % handles structure with handles and user data (see GUIDATA)
71 
72 % Get default command line output from handles structure
73 varargout{1} = handles.output;
74 
75 
76 % --- Executes on button press in reloadButton.
77 function reloadButton_Callback(hObject, eventdata, handles)
78 % hObject handle to reloadButton (see GCBO)
79 % eventdata reserved - to be defined in a future version of MATLAB
80 % handles structure with handles and user data (see GUIDATA)
81 ud = get(gcbf, 'UserData');
82 
83 angle = get(handles.angleSlider, 'Value');
84 plot_params.angle = angle;
85 plot_params.gcf = gcbf;
86 plot_params.reload_required = true;
87 plot_sim_data(ud.dmodel, [], ud.sim_data, plot_params);
88 
89 % --- Executes on slider movement.
90 function angleSlider_Callback(hObject, eventdata, handles)
91 % hObject handle to angleSlider (see GCBO)
92 % eventdata reserved - to be defined in a future version of MATLAB
93 % handles structure with handles and user data (see GUIDATA)
94 
95 ud = get(gcbf, 'UserData');
96 set(hObject, 'Min', 0);
97 set(hObject, 'Max', 2*pi);
98 set(hObject, 'SliderStep', [1 10]*pi/100);
99 angle = get(hObject, 'Value');
100 set(handles.angle, 'String', ['angle = ', num2str(angle)]);
101 plot_params.angle = angle;
102 plot_params.gcf = gcbf;
103 plot_sim_data(ud.dmodel, [], ud.sim_data, plot_params);
104 % Hints: get(hObject,'Value') returns position of slider
105 % get(hObject,'Min') and get(hObject,'Max') to determine range of slider
106 
107 
108 % --- Executes during object creation, after setting all properties.
109 function angleSlider_CreateFcn(hObject, eventdata, handles)
110 % hObject handle to angleSlider (see GCBO)
111 % eventdata reserved - to be defined in a future version of MATLAB
112 % handles empty - handles not created until after all CreateFcns called
113 
114 % Hint: slider controls usually have a light gray background.
115 if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
116  set(hObject,'BackgroundColor',[.9 .9 .9]);
117 end
118 
119 
120 % --- Executes on button press in exitButton.
121 function exitButton_Callback(hObject, eventdata, handles)
122 % hObject handle to exitButton (see GCBO)
123 % eventdata reserved - to be defined in a future version of MATLAB
124 % handles structure with handles and user data (see GUIDATA)
125 close(gcbf);
126 
127 % --- Executes during object creation, after setting all properties.
128 function figure1_CreateFcn(hObject, eventdata, handles)
129 % hObject handle to figure1 (see GCBO)
130 % eventdata reserved - to be defined in a future version of MATLAB
131 % handles empty - handles not created until after all CreateFcns called