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 | |
---|
1 | function 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 | |
---|
11 | global THERING |
---|
12 | |
---|
13 | match = findcells(THERING,'FamName',fname); |
---|
14 | if length(match) == 0 |
---|
15 | error(['Family ''',fname,''' is not found']); |
---|
16 | end |
---|
17 | |
---|
18 | % check number of names in the NAMELIST |
---|
19 | m = match(1); |
---|
20 | if length(match) == length(taglist) |
---|
21 | for i = 1:length(match) |
---|
22 | THERING{match(i)}.Tag = taglist{i}; |
---|
23 | end; |
---|
24 | else |
---|
25 | % Think of a clearer message |
---|
26 | error('The number of elements in TAGLIST must match the number of elements in the family FNAME') |
---|
27 | end |
---|
28 | |
---|
29 | |
---|
30 | |
---|
31 | |
---|
32 | |
---|
Note: See
TracBrowser
for help on using the repository browser.