source: MML/trunk/mml/getfamilylist.m @ 4

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 
1function  [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
11if nargin == 0
12    OutputFlag = 'Matrix';
13end
14
15AO = getao;
16
17if isempty(AO)
18    error('Initialization is needed (aoinit)');
19end
20
21if strcmpi(OutputFlag, 'Cell')
22    % Cell array output
23    Families = fieldnames(AO);
24else
25    % Matrix output
26    Families = [];
27    AOFamilyCell = fieldnames(AO);
28    for i = 1:length(AOFamilyCell)
29        Families = strvcat(Families, AOFamilyCell{i});
30    end
31end
32
33
34if 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
43end
44
Note: See TracBrowser for help on using the repository browser.