1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
---|
2 | "http://www.w3.org/TR/REC-html40/loose.dtd"> |
---|
3 | <html> |
---|
4 | <head> |
---|
5 | <title>Description of gettuneresp</title> |
---|
6 | <meta name="keywords" content="gettuneresp"> |
---|
7 | <meta name="description" content="GETTUNERESP - Loads the tune response vector (or matrix) for multiple quadrupole families"> |
---|
8 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
---|
9 | <meta name="generator" content="m2html © 2003 Guillaume Flandin"> |
---|
10 | <meta name="robots" content="index, follow"> |
---|
11 | <link type="text/css" rel="stylesheet" href="../m2html.css"> |
---|
12 | </head> |
---|
13 | <body> |
---|
14 | <a name="_top"></a> |
---|
15 | <div><a href="../index.html">Home</a> > <a href="index.html">mml</a> > gettuneresp.m</div> |
---|
16 | |
---|
17 | <!--<table width="100%"><tr><td align="left"><a href="../index.html"><img alt="<" border="0" src="../left.png"> Master index</a></td> |
---|
18 | <td align="right"><a href="index.html">Index for mml <img alt=">" border="0" src="../right.png"></a></td></tr></table>--> |
---|
19 | |
---|
20 | <h1>gettuneresp |
---|
21 | </h1> |
---|
22 | |
---|
23 | <h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2> |
---|
24 | <div class="box"><strong>GETTUNERESP - Loads the tune response vector (or matrix) for multiple quadrupole families</strong></div> |
---|
25 | |
---|
26 | <h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2> |
---|
27 | <div class="box"><strong>function [TuneMatrix, FileName] = gettuneresp(varargin) </strong></div> |
---|
28 | |
---|
29 | <h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2> |
---|
30 | <div class="fragment"><pre class="comment">GETTUNERESP - Loads the tune response vector (or matrix) for multiple quadrupole families |
---|
31 | [TuneMatrix, FileName] = gettuneresp(FamilyName1, DeviceList1, FamilyName2, DeviceList2, ... , FileName, GeV) |
---|
32 | [TuneMatrix, FileName] = gettuneresp(DataStructure1, DataStructure2, ... , FileName, GeV) |
---|
33 | |
---|
34 | INPUTS |
---|
35 | 1. FamilyName - Quadrupole family name |
---|
36 | 2. DeviceList - DeviceList for a quadrupole family. If [] or no input, then TuneMatrix |
---|
37 | will be a column vector which is the cumulative sum of all magnets in the family. |
---|
38 | 3. FileName - File name to look for the response matrix (or cell array of file names) |
---|
39 | '' prompts the user to choose a response matrix file |
---|
40 | 4. GeV will linearly scale the response matrix from the measured energy {Default: getenergy}. |
---|
41 | |
---|
42 | OUTPUTS |
---|
43 | 1. TuneMatrix = Response matrix |
---|
44 | |
---|
45 | It is assumed that most common use of this function is with the |
---|
46 | Q7 and Q9 families on a ganged power supply. Hence, the default |
---|
47 | behavior is to return the cumulative sum of all the magnets in the chain. |
---|
48 | If there is more than one FamilyName, then TuneMatrix will be a matrix |
---|
49 | where each column is the sum of the contribution of all magnets in that family. |
---|
50 | |
---|
51 | To get the response matrix for individual magnets in the family use getrespmat: |
---|
52 | getrespmat('TUNE', [1 1;1 2], MagnetFamilyName, MagnetDeviceList) |
---|
53 | For instance, getrespmat('TUNE', [1 1;1 2], 'Q1', []) |
---|
54 | |
---|
55 | EXAMPLES |
---|
56 | 1. M = gettuneresp |
---|
57 | M = gettuneresp({'Q7','Q9'}) |
---|
58 | M = gettuneresp({'Q7','Q9'},{[],[]}) |
---|
59 | M = gettuneresp('Q7',getlist('Q9')) |
---|
60 | All returns the same 2x2 matrix of Q7 and Q9 to horizontal and vertical tune |
---|
61 | |
---|
62 | 2. M = gettuneresp('Q7') |
---|
63 | M = gettuneresp('Q7', []) |
---|
64 | Returns a 2x1 matrix representing the cumulative sum of all the magnets in the chain |
---|
65 | |
---|
66 | 3. Q9_DataStruct = getsp('Q9','Struct'); |
---|
67 | M = gettuneresp(Q9_DataStruct); |
---|
68 | Returns a 2x1 matrix representing the cumulative sum of all the magnets in the chain |
---|
69 | |
---|
70 | 4. Change the tune by [.01; -.01] using the entire 'Q7' and 'Q9' families (see stepchro) |
---|
71 | DeltaTune = [.01; -.01]; |
---|
72 | DeltaAmps = inv(gettuneresp) * DeltaTune; |
---|
73 | setsp({'Q7', 'Q9'}, {getsp('Q7')+DeltaAmps(1), getsp('Q9')+DeltaAmps(2)});</pre></div> |
---|
74 | |
---|
75 | <!-- crossreference --> |
---|
76 | <h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2> |
---|
77 | This function calls: |
---|
78 | <ul style="list-style-image:url(../matlabicon.gif)"> |
---|
79 | <li><a href="findmemberof.html" class="code" title="function FamilyName = findmemberof(MemberString, Field)">findmemberof</a> FINDMEMBEROF - Finds all family members</li><li><a href="getfamilydata.html" class="code" title="function [Data, ErrorFlag] = getfamilydata(Family, Field1, Field2, DeviceList)">getfamilydata</a> GETFAMILYDATA - Gets data associated with the accelerator control</li><li><a href="getrespmat.html" class="code" title="function [S, FileName] = getrespmat(varargin)">getrespmat</a> GETRESPMAT - Get response matrix data from a file</li><li><a href="isfamily.html" class="code" title="function [FamilyFlag, AO] = isfamily(Family, Field)">isfamily</a> ISFAMILY - True for family names</li><li><a href="meastuneresp.html" class="code" title="function [Rmat, OutputFileName] = meastuneresp(varargin)">meastuneresp</a> MEASTUNERESP - Measures the response from quadrupole to tune</li></ul> |
---|
80 | This function is called by: |
---|
81 | <ul style="list-style-image:url(../matlabicon.gif)"> |
---|
82 | <li><a href="measidfftable.html" class="code" title="function ffgettbl(Sector, BPMFlag)">measidfftable</a> FFGETTBL - Measures an insertion device feed forward table for the vertical gap</li><li><a href="settune.html" class="code" title="function [DelQuad, ActuatorFamily] = settune(varargin)">settune</a> SETTUNE - Set the tune</li><li><a href="steptune.html" class="code" title="function [DelQuad, ActuatorFamily] = steptune(varargin)">steptune</a> STEPTUNE - Step the tune</li></ul> |
---|
83 | <!-- crossreference --> |
---|
84 | |
---|
85 | |
---|
86 | <h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2> |
---|
87 | <div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function [TuneMatrix, FileName] = gettuneresp(varargin)</a> |
---|
88 | 0002 <span class="comment">%GETTUNERESP - Loads the tune response vector (or matrix) for multiple quadrupole families</span> |
---|
89 | 0003 <span class="comment">% [TuneMatrix, FileName] = gettuneresp(FamilyName1, DeviceList1, FamilyName2, DeviceList2, ... , FileName, GeV)</span> |
---|
90 | 0004 <span class="comment">% [TuneMatrix, FileName] = gettuneresp(DataStructure1, DataStructure2, ... , FileName, GeV)</span> |
---|
91 | 0005 <span class="comment">%</span> |
---|
92 | 0006 <span class="comment">% INPUTS</span> |
---|
93 | 0007 <span class="comment">% 1. FamilyName - Quadrupole family name</span> |
---|
94 | 0008 <span class="comment">% 2. DeviceList - DeviceList for a quadrupole family. If [] or no input, then TuneMatrix</span> |
---|
95 | 0009 <span class="comment">% will be a column vector which is the cumulative sum of all magnets in the family.</span> |
---|
96 | 0010 <span class="comment">% 3. FileName - File name to look for the response matrix (or cell array of file names)</span> |
---|
97 | 0011 <span class="comment">% '' prompts the user to choose a response matrix file</span> |
---|
98 | 0012 <span class="comment">% 4. GeV will linearly scale the response matrix from the measured energy {Default: getenergy}.</span> |
---|
99 | 0013 <span class="comment">%</span> |
---|
100 | 0014 <span class="comment">% OUTPUTS</span> |
---|
101 | 0015 <span class="comment">% 1. TuneMatrix = Response matrix</span> |
---|
102 | 0016 <span class="comment">%</span> |
---|
103 | 0017 <span class="comment">% It is assumed that most common use of this function is with the</span> |
---|
104 | 0018 <span class="comment">% Q7 and Q9 families on a ganged power supply. Hence, the default</span> |
---|
105 | 0019 <span class="comment">% behavior is to return the cumulative sum of all the magnets in the chain.</span> |
---|
106 | 0020 <span class="comment">% If there is more than one FamilyName, then TuneMatrix will be a matrix</span> |
---|
107 | 0021 <span class="comment">% where each column is the sum of the contribution of all magnets in that family.</span> |
---|
108 | 0022 <span class="comment">%</span> |
---|
109 | 0023 <span class="comment">% To get the response matrix for individual magnets in the family use getrespmat:</span> |
---|
110 | 0024 <span class="comment">% getrespmat('TUNE', [1 1;1 2], MagnetFamilyName, MagnetDeviceList)</span> |
---|
111 | 0025 <span class="comment">% For instance, getrespmat('TUNE', [1 1;1 2], 'Q1', [])</span> |
---|
112 | 0026 <span class="comment">%</span> |
---|
113 | 0027 <span class="comment">% EXAMPLES</span> |
---|
114 | 0028 <span class="comment">% 1. M = gettuneresp</span> |
---|
115 | 0029 <span class="comment">% M = gettuneresp({'Q7','Q9'})</span> |
---|
116 | 0030 <span class="comment">% M = gettuneresp({'Q7','Q9'},{[],[]})</span> |
---|
117 | 0031 <span class="comment">% M = gettuneresp('Q7',getlist('Q9'))</span> |
---|
118 | 0032 <span class="comment">% All returns the same 2x2 matrix of Q7 and Q9 to horizontal and vertical tune</span> |
---|
119 | 0033 <span class="comment">%</span> |
---|
120 | 0034 <span class="comment">% 2. M = gettuneresp('Q7')</span> |
---|
121 | 0035 <span class="comment">% M = gettuneresp('Q7', [])</span> |
---|
122 | 0036 <span class="comment">% Returns a 2x1 matrix representing the cumulative sum of all the magnets in the chain</span> |
---|
123 | 0037 <span class="comment">%</span> |
---|
124 | 0038 <span class="comment">% 3. Q9_DataStruct = getsp('Q9','Struct');</span> |
---|
125 | 0039 <span class="comment">% M = gettuneresp(Q9_DataStruct);</span> |
---|
126 | 0040 <span class="comment">% Returns a 2x1 matrix representing the cumulative sum of all the magnets in the chain</span> |
---|
127 | 0041 <span class="comment">%</span> |
---|
128 | 0042 <span class="comment">% 4. Change the tune by [.01; -.01] using the entire 'Q7' and 'Q9' families (see stepchro)</span> |
---|
129 | 0043 <span class="comment">% DeltaTune = [.01; -.01];</span> |
---|
130 | 0044 <span class="comment">% DeltaAmps = inv(gettuneresp) * DeltaTune;</span> |
---|
131 | 0045 <span class="comment">% setsp({'Q7', 'Q9'}, {getsp('Q7')+DeltaAmps(1), getsp('Q9')+DeltaAmps(2)});</span> |
---|
132 | 0046 |
---|
133 | 0047 <span class="comment">%</span> |
---|
134 | 0048 <span class="comment">% Written by Gregory J. Portmann</span> |
---|
135 | 0049 <span class="comment">% Modified by Laurent S. Nadolski</span> |
---|
136 | 0050 |
---|
137 | 0051 FileName = <span class="string">''</span>; |
---|
138 | 0052 NumericFlag = 1; |
---|
139 | 0053 InputFlags = {}; |
---|
140 | 0054 <span class="keyword">for</span> i = length(varargin):-1:1 |
---|
141 | 0055 <span class="keyword">if</span> isstruct(varargin{i}) |
---|
142 | 0056 <span class="comment">% Ignore structures</span> |
---|
143 | 0057 <span class="keyword">elseif</span> iscell(varargin{i}) |
---|
144 | 0058 <span class="comment">% Ignore cells</span> |
---|
145 | 0059 <span class="keyword">elseif</span> strcmpi(varargin{i},<span class="string">'Struct'</span>) |
---|
146 | 0060 <span class="comment">% Remove</span> |
---|
147 | 0061 varargin(i) = []; |
---|
148 | 0062 <span class="keyword">elseif</span> strcmpi(varargin{i},<span class="string">'Numeric'</span>) |
---|
149 | 0063 <span class="comment">% Remove</span> |
---|
150 | 0064 varargin(i) = []; |
---|
151 | 0065 <span class="keyword">elseif</span> strcmpi(varargin{i},<span class="string">'Online'</span>) |
---|
152 | 0066 <span class="comment">% Remove</span> |
---|
153 | 0067 fprintf(<span class="string">'GETTUNERESP WARNING: ''Online'' input ignored. Used meastuneresp to get the chromaticity response matrix.'</span>); |
---|
154 | 0068 varargin(i) = []; |
---|
155 | 0069 <span class="keyword">elseif</span> strcmpi(varargin{i},<span class="string">'Simulator'</span>) |
---|
156 | 0070 <span class="comment">% Remove</span> |
---|
157 | 0071 fprintf(<span class="string">'GETTUNERESP WARNING: ''Simulator'' input ignored. Used meastuneresp to get the chromaticity response matrix.'</span>); |
---|
158 | 0072 varargin(i) = []; |
---|
159 | 0073 <span class="keyword">elseif</span> strcmpi(varargin{i},<span class="string">'Model'</span>) |
---|
160 | 0074 <span class="comment">% Remove</span> |
---|
161 | 0075 fprintf(<span class="string">'GETTUNERESP WARNING: ''Model'' input ignored. Used meastuneresp to get the model chromaticity response matrix.'</span>); |
---|
162 | 0076 varargin(i) = []; |
---|
163 | 0077 <span class="keyword">elseif</span> strcmpi(varargin{i},<span class="string">'Model'</span>) |
---|
164 | 0078 fprintf(<span class="string">'WARNING: ''Model'' input ignored. Used meastuneresp to get the model tune response matrix.'</span>); |
---|
165 | 0079 varargin(i) = []; |
---|
166 | 0080 <span class="keyword">elseif</span> strcmpi(varargin{i},<span class="string">'NoEnergyScaling'</span>) |
---|
167 | 0081 InputFlags = [InputFlags varargin(i)]; |
---|
168 | 0082 varargin(i) = []; |
---|
169 | 0083 <span class="keyword">elseif</span> strcmpi(varargin{i},<span class="string">'EnergyScaling'</span>) |
---|
170 | 0084 InputFlags = [InputFlags varargin(i)]; |
---|
171 | 0085 varargin(i) = []; |
---|
172 | 0086 <span class="keyword">elseif</span> strcmpi(varargin{i},<span class="string">'Physics'</span>) |
---|
173 | 0087 InputFlags = [InputFlags varargin(i)]; |
---|
174 | 0088 varargin(i) = []; |
---|
175 | 0089 <span class="keyword">elseif</span> strcmpi(varargin{i},<span class="string">'Hardware'</span>) |
---|
176 | 0090 InputFlags = [InputFlags varargin(i)]; |
---|
177 | 0091 varargin(i) = []; |
---|
178 | 0092 <span class="keyword">elseif</span> strcmpi(varargin{i},<span class="string">'FileName'</span>) |
---|
179 | 0093 <span class="keyword">if</span> length(varargin) >= i+1 & ischar(varargin{i+1}) |
---|
180 | 0094 FileName = varargin{i+1}; |
---|
181 | 0095 varargin(i:i+1) = []; |
---|
182 | 0096 <span class="keyword">else</span> |
---|
183 | 0097 varargin(i) = []; |
---|
184 | 0098 <span class="keyword">end</span> |
---|
185 | 0099 <span class="keyword">if</span> isempty(FileName) |
---|
186 | 0100 DirectoryName = <a href="getfamilydata.html" class="code" title="function [Data, ErrorFlag] = getfamilydata(Family, Field1, Field2, DeviceList)">getfamilydata</a>(<span class="string">'Directory'</span>, <span class="string">'TuneResponse'</span>); |
---|
187 | 0101 [FileName, DirectoryName] = uigetfile(<span class="string">'*.mat'</span>, <span class="string">'Select a TUNE response matrix file'</span>, DirectoryName); |
---|
188 | 0102 InputFlags = [InputFlags {[DirectoryName FileName]}]; |
---|
189 | 0103 <span class="keyword">else</span> |
---|
190 | 0104 InputFlags = [InputFlags {FileName}]; |
---|
191 | 0105 <span class="keyword">end</span> |
---|
192 | 0106 <span class="keyword">end</span> |
---|
193 | 0107 <span class="keyword">end</span> |
---|
194 | 0108 |
---|
195 | 0109 ActuatorFamilyDefault = <a href="findmemberof.html" class="code" title="function FamilyName = findmemberof(MemberString, Field)">findmemberof</a>(<span class="string">'Tune Corrector'</span>)'; |
---|
196 | 0110 <span class="keyword">if</span> isempty(ActuatorFamilyDefault) |
---|
197 | 0111 ActuatorFamilyDefault = {<span class="string">'Q7'</span>,<span class="string">'Q9'</span>}; |
---|
198 | 0112 <span class="keyword">end</span> |
---|
199 | 0113 |
---|
200 | 0114 <span class="keyword">if</span> length(varargin) == 0 |
---|
201 | 0115 FamilyNameCell = ActuatorFamilyDefault; |
---|
202 | 0116 DeviceListCell = cell(size(ActuatorFamilyDefault)); |
---|
203 | 0117 NumFamilies = length(FamilyNameCell); |
---|
204 | 0118 |
---|
205 | 0119 <span class="keyword">elseif</span> length(varargin) == 1 & isempty(varargin{1}) |
---|
206 | 0120 FamilyNameCell = ActuatorFamilyDefault; |
---|
207 | 0121 DeviceListCell = cell(size(ActuatorFamilyDefault)); |
---|
208 | 0122 NumFamilies = length(FamilyNameCell); |
---|
209 | 0123 |
---|
210 | 0124 <span class="keyword">elseif</span> iscell(varargin{1}) |
---|
211 | 0125 FamilyNameCell = varargin{1}; |
---|
212 | 0126 varargin(1) = []; |
---|
213 | 0127 <span class="keyword">if</span> length(varargin) >= 1 |
---|
214 | 0128 DeviceListCell = varargin{1}; |
---|
215 | 0129 varargin(1) = []; |
---|
216 | 0130 <span class="keyword">else</span> |
---|
217 | 0131 <span class="keyword">for</span> i = 1:length(FamilyNameCell) |
---|
218 | 0132 DeviceListCell{i} = []; |
---|
219 | 0133 <span class="keyword">end</span> |
---|
220 | 0134 <span class="keyword">end</span> |
---|
221 | 0135 NumFamilies = length(FamilyNameCell); |
---|
222 | 0136 <span class="keyword">if</span> ~iscell(DeviceListCell) |
---|
223 | 0137 error(<span class="string">'If FamilyName is a cell array then DeviceList must be a cell array'</span>) |
---|
224 | 0138 <span class="keyword">end</span> |
---|
225 | 0139 |
---|
226 | 0140 <span class="keyword">elseif</span> isstruct(varargin{1}) |
---|
227 | 0141 NumFamilies = 0; |
---|
228 | 0142 <span class="keyword">while</span> ~isempty(varargin) |
---|
229 | 0143 <span class="comment">% Look for Family and DeviceList</span> |
---|
230 | 0144 <span class="keyword">if</span> length(varargin) >= 1 |
---|
231 | 0145 <span class="keyword">if</span> ~isstruct(varargin{1}) |
---|
232 | 0146 <span class="keyword">break</span> |
---|
233 | 0147 <span class="keyword">end</span> |
---|
234 | 0148 <span class="keyword">if</span> ~<a href="isfamily.html" class="code" title="function [FamilyFlag, AO] = isfamily(Family, Field)">isfamily</a>(varargin{1}.FamilyName) |
---|
235 | 0149 error(<span class="string">'Unknown family name in data structure'</span>); |
---|
236 | 0150 <span class="keyword">end</span> |
---|
237 | 0151 NumFamilies = NumFamilies + 1; |
---|
238 | 0152 FamilyNameCell{NumFamilies} = varargin{1}.FamilyName; |
---|
239 | 0153 DeviceListCell{NumFamilies} = varargin{1}.DeviceList; |
---|
240 | 0154 varargin(1) = []; |
---|
241 | 0155 <span class="keyword">end</span> |
---|
242 | 0156 <span class="keyword">end</span> |
---|
243 | 0157 |
---|
244 | 0158 <span class="keyword">else</span> |
---|
245 | 0159 NumFamilies = 0; |
---|
246 | 0160 <span class="keyword">while</span> ~isempty(varargin) |
---|
247 | 0161 <span class="comment">% Look for Family and DeviceList</span> |
---|
248 | 0162 <span class="keyword">if</span> length(varargin) >= 1 |
---|
249 | 0163 <span class="keyword">if</span> ~<a href="isfamily.html" class="code" title="function [FamilyFlag, AO] = isfamily(Family, Field)">isfamily</a>(varargin{1}) |
---|
250 | 0164 <span class="keyword">break</span> |
---|
251 | 0165 <span class="keyword">end</span> |
---|
252 | 0166 NumFamilies = NumFamilies + 1; |
---|
253 | 0167 FamilyNameCell{NumFamilies} = varargin{1}; |
---|
254 | 0168 varargin(1) = []; |
---|
255 | 0169 <span class="keyword">end</span> |
---|
256 | 0170 <span class="keyword">if</span> length(varargin) >= 1 |
---|
257 | 0171 <span class="keyword">if</span> isnumeric(varargin{1}) | isempty(varargin{1}) |
---|
258 | 0172 DeviceListCell{NumFamilies} = varargin{1}; |
---|
259 | 0173 varargin(1) = []; |
---|
260 | 0174 <span class="keyword">else</span> |
---|
261 | 0175 DeviceListCell{NumFamilies} = []; |
---|
262 | 0176 <span class="keyword">end</span> |
---|
263 | 0177 <span class="keyword">else</span> |
---|
264 | 0178 DeviceListCell{NumFamilies} = []; |
---|
265 | 0179 <span class="keyword">end</span> |
---|
266 | 0180 <span class="keyword">end</span> |
---|
267 | 0181 <span class="keyword">end</span> |
---|
268 | 0182 |
---|
269 | 0183 <span class="comment">% FileName should be the next input (if a string, or [] for dialog box)</span> |
---|
270 | 0184 <span class="keyword">if</span> length(varargin) >= 1 |
---|
271 | 0185 <span class="keyword">if</span> ischar(varargin{1}) | isempty(varargin{1}) |
---|
272 | 0186 FileName = varargin{1}; |
---|
273 | 0187 varargin(1) = []; |
---|
274 | 0188 |
---|
275 | 0189 <span class="keyword">if</span> isempty(FileName) |
---|
276 | 0190 <span class="comment">% Note: This only works if all families are in the same file</span> |
---|
277 | 0191 DirectoryName = <a href="getfamilydata.html" class="code" title="function [Data, ErrorFlag] = getfamilydata(Family, Field1, Field2, DeviceList)">getfamilydata</a>(<span class="string">'Directory'</span>, <span class="string">'TuneResponse'</span>); |
---|
278 | 0192 [FileName, DirectoryName, FilterIndex] = uigetfile(<span class="string">'*.mat'</span>,<span class="string">'Select Quadrupole-to-Tune Response Matrix File'</span>, DirectoryName); |
---|
279 | 0193 <span class="keyword">if</span> FilterIndex == 0 |
---|
280 | 0194 TuneMatrix = []; |
---|
281 | 0195 FileName = []; |
---|
282 | 0196 <span class="keyword">return</span> |
---|
283 | 0197 <span class="keyword">end</span> |
---|
284 | 0198 |
---|
285 | 0199 FileName = [DirectoryName FileName]; |
---|
286 | 0200 InputFlags = [{FileName} InputFlags]; |
---|
287 | 0201 <span class="keyword">end</span> |
---|
288 | 0202 <span class="keyword">end</span> |
---|
289 | 0203 <span class="keyword">end</span> |
---|
290 | 0204 |
---|
291 | 0205 |
---|
292 | 0206 <span class="comment">% The only thing left on the input line can be energy which can be left in varargin</span> |
---|
293 | 0207 |
---|
294 | 0208 |
---|
295 | 0209 <span class="comment">% Get the response matrix</span> |
---|
296 | 0210 <span class="keyword">if</span> NumericFlag == 1 |
---|
297 | 0211 TuneMatrix = []; |
---|
298 | 0212 <span class="keyword">end</span> |
---|
299 | 0213 <span class="keyword">for</span> i = 1:NumFamilies |
---|
300 | 0214 <span class="keyword">if</span> NumericFlag == 1 |
---|
301 | 0215 <span class="keyword">try</span> |
---|
302 | 0216 [M, FileName] = <a href="getrespmat.html" class="code" title="function [S, FileName] = getrespmat(varargin)">getrespmat</a>(<span class="string">'TUNE'</span>, [1 1;1 2], FamilyNameCell{i}, DeviceListCell{i}, <span class="string">'Numeric'</span>, InputFlags{:}, varargin{:}); |
---|
303 | 0217 <span class="keyword">catch</span> |
---|
304 | 0218 fprintf(<span class="string">' Could not find a TUNE response matrix file, so using the model (%s).\n'</span>, FamilyNameCell{i}); |
---|
305 | 0219 M = <a href="meastuneresp.html" class="code" title="function [Rmat, OutputFileName] = meastuneresp(varargin)">meastuneresp</a>(FamilyNameCell{i}, DeviceListCell{i}, <span class="string">'Model'</span>, <span class="string">'Numeric'</span>, InputFlags{:}, varargin{:}); |
---|
306 | 0220 <span class="comment">%M = measrespmat('TUNE', [1 1;1 2], FamilyNameCell{i}, DeviceListCell{i}, 'Model', 'Numeric', InputFlags{:}, varargin{:});</span> |
---|
307 | 0221 FileName = <span class="string">''</span>; |
---|
308 | 0222 <span class="keyword">end</span> |
---|
309 | 0223 TuneMatrix = [TuneMatrix sum(M,2)]; |
---|
310 | 0224 <span class="keyword">else</span> |
---|
311 | 0225 <span class="keyword">try</span> |
---|
312 | 0226 [TuneMatrix(1,i), FileName] = <a href="getrespmat.html" class="code" title="function [S, FileName] = getrespmat(varargin)">getrespmat</a>(<span class="string">'TUNE'</span>, [1 1;1 2], FamilyNameCell{i}, DeviceListCell{i}, <span class="string">'Struct'</span>, InputFlags{:}, varargin{:}); |
---|
313 | 0227 <span class="keyword">catch</span> |
---|
314 | 0228 fprintf(<span class="string">' Could not find a TUNE response matrix file, so using the model (%s).\n'</span>, FamilyNameCell{i}); |
---|
315 | 0229 TuneMatrix(1,i) = <a href="meastuneresp.html" class="code" title="function [Rmat, OutputFileName] = meastuneresp(varargin)">meastuneresp</a>(FamilyNameCell{i}, DeviceListCell{i}, <span class="string">'Model'</span>, <span class="string">'Struct'</span>, InputFlags{:}, varargin{:}); |
---|
316 | 0230 FileName = <span class="string">''</span>; |
---|
317 | 0231 <span class="keyword">end</span> |
---|
318 | 0232 <span class="keyword">end</span> |
---|
319 | 0233 <span class="keyword">end</span> |
---|
320 | 0234 |
---|
321 | 0235</pre></div> |
---|
322 | <hr><address>Generated on Mon 21-May-2007 15:29:18 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> © 2003</address> |
---|
323 | </body> |
---|
324 | </html> |
---|