source: MML/trunk/mml/at/setpassmethod.m @ 4

Last change on this file since 4 was 4, checked in by zhangj, 10 years ago

Initial import--MML version from SOLEIL@2013

File size: 1.3 KB
Line 
1function 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
19global THERING
20
21if nargin < 2
22    error('2 inputs required.');
23end
24if isempty(ATIndex)
25    return
26end
27if isempty(PassMethod)
28    return
29end
30
31
32if ischar(ATIndex)
33    if nargin >= 3
34        ATIndex = family2atindex(ATIndex, DeviceList);
35    else
36        ATIndex = family2atindex(ATIndex);
37    end
38end
39
40
41for 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
55end
56
57
Note: See TracBrowser for help on using the repository browser.