Last change
on this file since 4 was
4,
checked in by zhangj, 11 years ago
|
Initial import--MML version from SOLEIL@2013
|
File size:
972 bytes
|
Line | |
---|
1 | function [Families, AO] = getfamilylist(OutputFlag) |
---|
2 | %GETFAMILYLIST - Returns a list of all the family names |
---|
3 | % |
---|
4 | % [Families, AO] = getfamilylist (matrix of strings) |
---|
5 | % [Families, AO] = getfamilylist('Cell') (cell array of strings) |
---|
6 | % |
---|
7 | % See also showao, showfamily, isfamily |
---|
8 | % |
---|
9 | % Written by Greg Portmann |
---|
10 | |
---|
11 | if nargin == 0 |
---|
12 | OutputFlag = 'Matrix'; |
---|
13 | end |
---|
14 | |
---|
15 | AO = getao; |
---|
16 | |
---|
17 | if isempty(AO) |
---|
18 | error('Initialization is needed (aoinit)'); |
---|
19 | end |
---|
20 | |
---|
21 | if strcmpi(OutputFlag, 'Cell') |
---|
22 | % Cell array output |
---|
23 | Families = fieldnames(AO); |
---|
24 | else |
---|
25 | % Matrix output |
---|
26 | Families = []; |
---|
27 | AOFamilyCell = fieldnames(AO); |
---|
28 | for i = 1:length(AOFamilyCell) |
---|
29 | Families = strvcat(Families, AOFamilyCell{i}); |
---|
30 | end |
---|
31 | end |
---|
32 | |
---|
33 | |
---|
34 | if nargout == 0 |
---|
35 | % Print to the screen |
---|
36 | for i = 1:size(Families,1) |
---|
37 | if strcmpi(OutputFlag, 'Cell') |
---|
38 | fprintf(' %2d. %s\n', i, Families{i}); |
---|
39 | else |
---|
40 | fprintf(' %2d. %s\n', i, deblank(Families(i,:))); |
---|
41 | end |
---|
42 | end |
---|
43 | end |
---|
44 | |
---|
Note: See
TracBrowser
for help on using the repository browser.