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 ismemberof</title> |
---|
6 | <meta name="keywords" content="ismemberof"> |
---|
7 | <meta name="description" content="ISMEMBEROF - Returns turn if 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 © 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> > <a href="index.html">mml</a> > ismemberof.m</div> |
---|
16 | |
---|
17 | <!--<table width="100%"><tr><td align="left"><a href="../index.html"><img alt="<" border="0" src="../left.png"> Master index</a></td> |
---|
18 | <td align="right"><a href="index.html">Index for mml <img alt=">" border="0" src="../right.png"></a></td></tr></table>--> |
---|
19 | |
---|
20 | <h1>ismemberof |
---|
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>ISMEMBEROF - Returns turn if 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 [IsTest, Index] = ismemberof(FamilyName, Field, MemberString) </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">ISMEMBEROF - Returns turn if the membership information of a family (cell of strings) |
---|
31 | [MemberOfBooleanVector, Index] = ismemberof(FamilyName, MemberString) |
---|
32 | |
---|
33 | If FamilyName is a matrix, then a column of individual ismemberof calls is returned. |
---|
34 | MemberString must be a string. |
---|
35 | If the family was not found, then [] is returned. |
---|
36 | |
---|
37 | An optional Field input can be used to only look through subfields. |
---|
38 | [MemberOfBooleanVector, Index] = ismemberof(FamilyName, Field, MemberString) |
---|
39 | Subfield membership is usually not used. |
---|
40 | |
---|
41 | INPUTS |
---|
42 | 1. If FamilyName is a matrix, then a column of individual ismemberof calls is returned. |
---|
43 | 2. MemberString must be a string. |
---|
44 | If the family was not found, then [] is returned. |
---|
45 | |
---|
46 | |
---|
47 | See Also <a href="getmemberof.html" class="code" title="function MemberOfCell = getmemberof(FamilyName, Field)">getmemberof</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></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> |
---|
51 | This function calls: |
---|
52 | <ul style="list-style-image:url(../matlabicon.gif)"> |
---|
53 | <li><a href="getmemberof.html" class="code" title="function MemberOfCell = getmemberof(FamilyName, Field)">getmemberof</a> GETMEMBEROF - Returns the membership information of a family (cell of strings)</li></ul> |
---|
54 | This function is called by: |
---|
55 | <ul style="list-style-image:url(../matlabicon.gif)"> |
---|
56 | <li><a href="getcrunch.html" class="code" title="function Data = getcrunch(varargin)">getcrunch</a> GETCRUNCH- Returns the crunch values for a family (radians)</li><li><a href="getdata.html" class="code" title="function [S, FileName] = getdata(varargin)">getdata</a> GETDATA - Searches through a file (or group of files) for a data structure which matches the family name</li><li><a href="getgain.html" class="code" title="function Data = getgain(varargin)">getgain</a> GETGAIN - Returns the gain for a family</li><li><a href="getgolden.html" class="code" title="function Data = getgolden(varargin)">getgolden</a> GETGOLDEN - Returns the golden values for a family</li><li><a href="getmachineconfig.html" class="code" title="function [ConfigSetpoint, ConfigMonitor, FileName] = getmachineconfig(varargin)">getmachineconfig</a> GETMACHINECONFIG - Returns or saves to file the present storage ring setpoints and monitors</li><li><a href="getoffset.html" class="code" title="function Data = getoffset(varargin)">getoffset</a> GETOFFSET - Returns the offset values for a family</li><li><a href="getroll.html" class="code" title="function Data = getroll(varargin)">getroll</a> GETROLL - Returns the roll values for a family (radians)</li><li><a href="hw2physics.html" class="code" title="function S = hw2physics(Family, Field, value, DeviceList, Energy)">hw2physics</a> HW2PHYSICS - Converts from 'Hardware' units to 'Physics' units</li><li><a href="makephysdata.html" class="code" title="function makephysdata(varargin)">makephysdata</a> MAKEPHYSDATA - Make a starting physics data file</li><li><a href="measbpmresp.html" class="code" title="function [Rmat, OutputFileName] = measbpmresp(varargin)">measbpmresp</a> MEASBPMRESP - Measures the BPM response matrix in the horizontal and vertical planes</li><li><a href="orbitcorrectionmethods.html" class="code" title="function [OCS, SmatNoWeights, S, U, V] = orbitcorrectionmethods(OCS, Smat, S, U, V)">orbitcorrectionmethods</a> ORBITCORRECTIONMETHODS - Some the orbit correction methods used on light sources</li><li><a href="physics2hw.html" class="code" title="function S = physics2hw(Family, Field, value, DeviceList, Energy)">physics2hw</a> PHYSICS2HW - Converts from 'Physics' units to 'Hardware' units</li><li><a href="quad2bpm.html" class="code" title="function [BPMFamilyOutput, BPMDevOutput, DeltaSpos, PhaseAdvance] = quad2bpm(QUADFamily, QUADDev, LocationFlag)">quad2bpm</a> QUAD2BPM - Returns the nearest BPM to the specified quadrupole</li><li><a href="quadcenter.html" class="code" title="function [QMS1, QMS2] = quadcenter(QuadFamily, QuadDev, XYPlane, FigureHandle)">quadcenter</a> QUADCENTER - Measure the magnet center of a quadrupole magnet</li><li><a href="quadcenterinit.html" class="code" title="function QMS = quadcenterinit(QuadFamily, QuadDev, QuadPlane)">quadcenterinit</a> QMS = quadcenterinit(Family, Device, QuadPlane)</li><li><a href="rmgolden.html" class="code" title="function Data = rmgolden(varargin)">rmgolden</a> RMGOLDEN - Remove the golden values for data set</li><li><a href="rmoffset.html" class="code" title="function Data = rmoffset(varargin)">rmoffset</a> RMOFFSET - Remove the offset values for data set</li><li><a href="sext2bpm.html" class="code" title="function [BPMFamilyOutput, BPMDevOutput, DeltaSpos] = sext2bpm(SEXTFamily, SEXTDev)">sext2bpm</a> SEXT2BPM - Returns the nearest BPM to the specified sextupole</li><li><a href="showmachinedata.html" class="code" title="function showmachinedata(families)">showmachinedata</a> SHOWMACHINEDATA - Display setpoints and readbacks for families in AcceleratorObjects</li><li><a href="sweepenergy.html" class="code" title="function sweepenergy(PercentChangeInEnergy)">sweepenergy</a> SWEEPENERGY - Energy sweep of the storage ring</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 [IsTest, Index] = ismemberof(FamilyName, Field, MemberString)</a> |
---|
62 | 0002 <span class="comment">%ISMEMBEROF - Returns turn if the membership information of a family (cell of strings)</span> |
---|
63 | 0003 <span class="comment">% [MemberOfBooleanVector, Index] = ismemberof(FamilyName, MemberString)</span> |
---|
64 | 0004 <span class="comment">%</span> |
---|
65 | 0005 <span class="comment">% If FamilyName is a matrix, then a column of individual ismemberof calls is returned.</span> |
---|
66 | 0006 <span class="comment">% MemberString must be a string.</span> |
---|
67 | 0007 <span class="comment">% If the family was not found, then [] is returned.</span> |
---|
68 | 0008 <span class="comment">%</span> |
---|
69 | 0009 <span class="comment">% An optional Field input can be used to only look through subfields.</span> |
---|
70 | 0010 <span class="comment">% [MemberOfBooleanVector, Index] = ismemberof(FamilyName, Field, MemberString)</span> |
---|
71 | 0011 <span class="comment">% Subfield membership is usually not used.</span> |
---|
72 | 0012 <span class="comment">%</span> |
---|
73 | 0013 <span class="comment">% INPUTS</span> |
---|
74 | 0014 <span class="comment">% 1. If FamilyName is a matrix, then a column of individual ismemberof calls is returned.</span> |
---|
75 | 0015 <span class="comment">% 2. MemberString must be a string.</span> |
---|
76 | 0016 <span class="comment">% If the family was not found, then [] is returned.</span> |
---|
77 | 0017 <span class="comment">%</span> |
---|
78 | 0018 <span class="comment">%</span> |
---|
79 | 0019 <span class="comment">% See Also getmemberof, findmemberof, isfamily</span> |
---|
80 | 0020 |
---|
81 | 0021 <span class="comment">%</span> |
---|
82 | 0022 <span class="comment">% Written by Gregory J. Portmann</span> |
---|
83 | 0023 |
---|
84 | 0024 <span class="keyword">if</span> nargin < 2 |
---|
85 | 0025 error(<span class="string">'2 inputs required'</span>); |
---|
86 | 0026 <span class="keyword">end</span> |
---|
87 | 0027 <span class="keyword">if</span> nargin == 2 |
---|
88 | 0028 MemberString = Field; |
---|
89 | 0029 <span class="keyword">end</span> |
---|
90 | 0030 |
---|
91 | 0031 <span class="keyword">if</span> isstruct(FamilyName) |
---|
92 | 0032 <span class="keyword">if</span> isfield(FamilyName, <span class="string">'FamilyName'</span>) |
---|
93 | 0033 FamilyName = FamilyName.FamilyName; |
---|
94 | 0034 <span class="keyword">else</span> |
---|
95 | 0035 error(<span class="string">'For structure inputs, FamilyName field must exist'</span>); |
---|
96 | 0036 <span class="keyword">end</span> |
---|
97 | 0037 <span class="keyword">end</span> |
---|
98 | 0038 |
---|
99 | 0039 IsTest = []; |
---|
100 | 0040 Index = []; |
---|
101 | 0041 <span class="keyword">for</span> i = 1:size(FamilyName,1) |
---|
102 | 0042 Family = deblank(FamilyName(i,:)); |
---|
103 | 0043 <span class="keyword">if</span> nargin == 2 |
---|
104 | 0044 IsTest(i,1) = any(strcmpi(MemberString, <a href="getmemberof.html" class="code" title="function MemberOfCell = getmemberof(FamilyName, Field)">getmemberof</a>(Family))); |
---|
105 | 0045 <span class="keyword">else</span> |
---|
106 | 0046 IsTest(i,1) = any(strcmpi(MemberString, <a href="getmemberof.html" class="code" title="function MemberOfCell = getmemberof(FamilyName, Field)">getmemberof</a>(Family, Field))); |
---|
107 | 0047 <span class="keyword">end</span> |
---|
108 | 0048 <span class="keyword">if</span> IsTest(i,1) == 1 |
---|
109 | 0049 Index = [Index; i]; |
---|
110 | 0050 <span class="keyword">end</span> |
---|
111 | 0051 <span class="keyword">end</span></pre></div> |
---|
112 | <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> © 2003</address> |
---|
113 | </body> |
---|
114 | </html> |
---|