1 | function setpassmethod(ATIndex, PassMethod, DeviceList) |
---|
2 | %SETPASSMETHOD - Sets the PassMethod |
---|
3 | % setpassmethod(Family, PassMethod, DeviceList) |
---|
4 | % setpassmethod(ATIndex, PassMethod) |
---|
5 | % setpassmethod(FamName, PassMethod) |
---|
6 | % |
---|
7 | % INPUTS |
---|
8 | % 1. Family, ATIndex, FamName |
---|
9 | % 2. PassMethod - String, string matrix, or cell array |
---|
10 | % 3. DeviceList (optional if using a Family name) |
---|
11 | % |
---|
12 | % See also getpassmethod, getcavity |
---|
13 | % |
---|
14 | % Written by Greg Portmann |
---|
15 | |
---|
16 | |
---|
17 | |
---|
18 | |
---|
19 | global THERING |
---|
20 | |
---|
21 | if nargin < 2 |
---|
22 | error('2 inputs required.'); |
---|
23 | end |
---|
24 | if isempty(ATIndex) |
---|
25 | return |
---|
26 | end |
---|
27 | if isempty(PassMethod) |
---|
28 | return |
---|
29 | end |
---|
30 | |
---|
31 | |
---|
32 | if ischar(ATIndex) |
---|
33 | if nargin >= 3 |
---|
34 | ATIndex = family2atindex(ATIndex, DeviceList); |
---|
35 | else |
---|
36 | ATIndex = family2atindex(ATIndex); |
---|
37 | end |
---|
38 | end |
---|
39 | |
---|
40 | |
---|
41 | for i = 1:length(ATIndex) |
---|
42 | if iscell(PassMethod) |
---|
43 | if length(PassMethod) == 1 |
---|
44 | THERING = setcellstruct(THERING, 'PassMethod', ATIndex(i), deblank(PassMethod{1})); |
---|
45 | else |
---|
46 | THERING = setcellstruct(THERING, 'PassMethod', ATIndex(i), deblank(PassMethod{i})); |
---|
47 | end |
---|
48 | else |
---|
49 | if size(PassMethod,1) == 1 |
---|
50 | THERING = setcellstruct(THERING, 'PassMethod', ATIndex(i), deblank(PassMethod(1,:))); |
---|
51 | else |
---|
52 | THERING = setcellstruct(THERING, 'PassMethod', ATIndex(i), deblank(PassMethod(i,:))); |
---|
53 | end |
---|
54 | end |
---|
55 | end |
---|
56 | |
---|
57 | |
---|