source: MML/trunk/mml/doc_html/mml/getmemberof.html @ 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: 8.7 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2                "http://www.w3.org/TR/REC-html40/loose.dtd">
3<html>
4<head>
5  <title>Description of getmemberof</title>
6  <meta name="keywords" content="getmemberof">
7  <meta name="description" content="GETMEMBEROF - Returns the membership information of a family (cell of strings)">
8  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
9  <meta name="generator" content="m2html &copy; 2003 Guillaume Flandin">
10  <meta name="robots" content="index, follow">
11  <link type="text/css" rel="stylesheet" href="../m2html.css">
12</head>
13<body>
14<a name="_top"></a>
15<div><a href="../index.html">Home</a> &gt;  <a href="index.html">mml</a> &gt; getmemberof.m</div>
16
17<!--<table width="100%"><tr><td align="left"><a href="../index.html"><img alt="<" border="0" src="../left.png">&nbsp;Master index</a></td>
18<td align="right"><a href="index.html">Index for mml&nbsp;<img alt=">" border="0" src="../right.png"></a></td></tr></table>-->
19
20<h1>getmemberof
21</h1>
22
23<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
24<div class="box"><strong>GETMEMBEROF - Returns the membership information of a family (cell of strings)</strong></div>
25
26<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
27<div class="box"><strong>function  MemberOfCell = getmemberof(FamilyName, Field) </strong></div>
28
29<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
30<div class="fragment"><pre class="comment">GETMEMBEROF - Returns the membership information of a family (cell of strings)
31  MemberOfCell = getmemberof(FamilyName)
32 
33  If FamilyName is a matrix, then a column of cells is returned.
34  If the family was not found, then {[]} is returned
35
36  An optional Field input can be used to only look through subfields.
37  MemberOfCell = getmemberof(FamilyName, Field)
38  Subfield membership is usually not used.
39
40  NOTE
41  1. If no input, then the all families will be returned
42     MemberOfCell = getmemberof;
43  2. If no output, then the MemberOf strings will be printed to the screen
44
45  See also <a href="ismemberof.html" class="code" title="function  [IsTest, Index] = ismemberof(FamilyName, Field, MemberString)">ismemberof</a>, <a href="findmemberof.html" class="code" title="function  FamilyName = findmemberof(MemberString, Field)">findmemberof</a>, <a href="isfamily.html" class="code" title="function  [FamilyFlag, AO] = isfamily(Family, Field)">isfamily</a>, <a href="getfamilylist.html" class="code" title="function  [Families, AO] = getfamilylist(OutputFlag)">getfamilylist</a>
46
47  Written by Greg Portmann</pre></div>
48
49<!-- crossreference -->
50<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
51This function calls:
52<ul style="list-style-image:url(../matlabicon.gif)">
53<li><a href="getfamilydata.html" class="code" title="function [Data, ErrorFlag] = getfamilydata(Family, Field1, Field2, DeviceList)">getfamilydata</a>  GETFAMILYDATA - Gets data associated with the accelerator control</li><li><a href="getfamilylist.html" class="code" title="function  [Families, AO] = getfamilylist(OutputFlag)">getfamilylist</a>      GETFAMILYLIST - Returns a list of all the family names</li></ul>
54This function is called by:
55<ul style="list-style-image:url(../matlabicon.gif)">
56<li><a href="findmemberof.html" class="code" title="function  FamilyName = findmemberof(MemberString, Field)">findmemberof</a>  FINDMEMBEROF - Finds all family members</li><li><a href="ismemberof.html" class="code" title="function  [IsTest, Index] = ismemberof(FamilyName, Field, MemberString)">ismemberof</a>   ISMEMBEROF - Returns turn if the membership information of a family (cell of strings)</li></ul>
57<!-- crossreference -->
58
59
60<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
61<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function  MemberOfCell = getmemberof(FamilyName, Field)</a>
620002 <span class="comment">%GETMEMBEROF - Returns the membership information of a family (cell of strings)</span>
630003 <span class="comment">%  MemberOfCell = getmemberof(FamilyName)</span>
640004 <span class="comment">%</span>
650005 <span class="comment">%  If FamilyName is a matrix, then a column of cells is returned.</span>
660006 <span class="comment">%  If the family was not found, then {[]} is returned</span>
670007 <span class="comment">%</span>
680008 <span class="comment">%  An optional Field input can be used to only look through subfields.</span>
690009 <span class="comment">%  MemberOfCell = getmemberof(FamilyName, Field)</span>
700010 <span class="comment">%  Subfield membership is usually not used.</span>
710011 <span class="comment">%</span>
720012 <span class="comment">%  NOTE</span>
730013 <span class="comment">%  1. If no input, then the all families will be returned</span>
740014 <span class="comment">%     MemberOfCell = getmemberof;</span>
750015 <span class="comment">%  2. If no output, then the MemberOf strings will be printed to the screen</span>
760016 <span class="comment">%</span>
770017 <span class="comment">%  See also ismemberof, findmemberof, isfamily, getfamilylist</span>
780018 <span class="comment">%</span>
790019 <span class="comment">%  Written by Greg Portmann</span>
800020
810021
820022 <span class="keyword">if</span> nargin &lt; 1
830023     FamilyName = <a href="getfamilylist.html" class="code" title="function  [Families, AO] = getfamilylist(OutputFlag)">getfamilylist</a>;
840024 <span class="keyword">end</span>
850025
860026
870027 MemberOfCell = {};
880028 <span class="keyword">for</span> i = 1:size(FamilyName,1)
890029     Family = deblank(FamilyName(i,:));
900030     <span class="keyword">if</span> nargin &gt;= 2
910031         <span class="keyword">if</span> size(Field,1) == 1
920032             a = <a href="getfamilydata.html" class="code" title="function [Data, ErrorFlag] = getfamilydata(Family, Field1, Field2, DeviceList)">getfamilydata</a>(Family, deblank(Field), <span class="string">'MemberOf'</span>);
930033         <span class="keyword">else</span>
940034             a = <a href="getfamilydata.html" class="code" title="function [Data, ErrorFlag] = getfamilydata(Family, Field1, Field2, DeviceList)">getfamilydata</a>(Family, deblank(Field(i,:)), <span class="string">'MemberOf'</span>);
950035         <span class="keyword">end</span>
960036     <span class="keyword">else</span>
970037         a = <a href="getfamilydata.html" class="code" title="function [Data, ErrorFlag] = getfamilydata(Family, Field1, Field2, DeviceList)">getfamilydata</a>(Family, <span class="string">'MemberOf'</span>);
980038     <span class="keyword">end</span>
990039     MemberOfCell{i,1} = a(:)';
1000040 <span class="keyword">end</span>
1010041
1020042
1030043 <span class="keyword">if</span> nargout == 0
1040044     <span class="comment">% Print to the screen</span>
1050045     <span class="keyword">if</span> nargin == 1
1060046         fprintf(<span class="string">'   #  Family:    Memberships \n'</span>);
1070047     <span class="keyword">else</span>
1080048         fprintf(<span class="string">'   #  Family.Field:    Memberships \n'</span>);
1090049     <span class="keyword">end</span>
1100050     <span class="keyword">for</span> i = 1:size(MemberOfCell,1)
1110051         <span class="keyword">if</span> nargin == 1
1120052             fprintf(<span class="string">'  %2d. %s:'</span>, i, deblank(FamilyName(i,:)));
1130053         <span class="keyword">else</span>
1140054             <span class="keyword">if</span> size(Field,1) == 1
1150055                 fprintf(<span class="string">'  %2d. %s.%s:'</span>, i, deblank(FamilyName(i,:)), deblank(Field));
1160056             <span class="keyword">else</span>
1170057                 fprintf(<span class="string">'  %2d. %s.%s:'</span>, i, deblank(FamilyName(i,:)), deblank(Field(i,:)));
1180058             <span class="keyword">end</span>
1190059         <span class="keyword">end</span>
1200060         Members = MemberOfCell{i};
1210061         <span class="keyword">for</span> j = 1:length(Members)
1220062             fprintf(<span class="string">&quot;%s&quot;'</span>, Members{j});
1230063         <span class="keyword">end</span>
1240064         fprintf(<span class="string">' \n'</span>);
1250065     <span class="keyword">end</span>
1260066 <span class="keyword">else</span>
1270067     <span class="comment">% For one family, returns a cell array, not cell array of cell arrays</span>
1280068     <span class="keyword">if</span> length(MemberOfCell) == 1
1290069         MemberOfCell = MemberOfCell{1};
1300070     <span class="keyword">end</span>
1310071 <span class="keyword">end</span></pre></div>
132<hr><address>Generated on Mon 21-May-2007 15:29:18 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> &copy; 2003</address>
133</body>
134</html>
Note: See TracBrowser for help on using the repository browser.