source: MML/trunk/at/lattice/settags.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: 879 bytes
Line 
1function settags(fname,taglist)
2%SETTAGS assigns individual string tags to elements in lattice THERING
3%
4% SETTAGS(FNAME,TAGLIST) finds the family with name FNAME
5% For each element in THERING, that belongs to this family,
6% SETTAGS crates a new field 'Tag' and initializes
7% it to the corresponding string in the cell array TAGLIST
8% TAGLIST must have the same number of elements as the
9% NumKids in this family
10
11global THERING
12
13match = findcells(THERING,'FamName',fname);
14if length(match) == 0
15   error(['Family ''',fname,''' is not found']); 
16end
17
18% check number of names in the NAMELIST
19m = match(1);
20if length(match) == length(taglist)
21   for i = 1:length(match)
22      THERING{match(i)}.Tag = taglist{i};
23   end;
24else
25   % Think of a clearer message
26   error('The number of elements in TAGLIST must match the number of elements in the family FNAME')
27end
28
29   
30
31     
32   
Note: See TracBrowser for help on using the repository browser.