source: MML/trunk/mml/doc_html/mml/ismemberof.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: 10.3 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 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 &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; ismemberof.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>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>
51This 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>
54This 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>
620002 <span class="comment">%ISMEMBEROF - Returns turn if the membership information of a family (cell of strings)</span>
630003 <span class="comment">%  [MemberOfBooleanVector, Index] = ismemberof(FamilyName, MemberString)</span>
640004 <span class="comment">%</span>
650005 <span class="comment">%  If FamilyName is a matrix, then a column of individual ismemberof calls is returned.</span>
660006 <span class="comment">%  MemberString must be a string.</span>
670007 <span class="comment">%  If the family was not found, then [] is returned.</span>
680008 <span class="comment">%</span>
690009 <span class="comment">%  An optional Field input can be used to only look through subfields.</span>
700010 <span class="comment">%  [MemberOfBooleanVector, Index] = ismemberof(FamilyName, Field, MemberString)</span>
710011 <span class="comment">%  Subfield membership is usually not used.</span>
720012 <span class="comment">%</span>
730013 <span class="comment">% INPUTS</span>
740014 <span class="comment">%  1. If FamilyName is a matrix, then a column of individual ismemberof calls is returned.</span>
750015 <span class="comment">%  2. MemberString must be a string.</span>
760016 <span class="comment">%  If the family was not found, then [] is returned.</span>
770017 <span class="comment">%</span>
780018 <span class="comment">%</span>
790019 <span class="comment">%  See Also getmemberof, findmemberof, isfamily</span>
800020
810021 <span class="comment">%</span>
820022 <span class="comment">%  Written by Gregory J. Portmann</span>
830023
840024 <span class="keyword">if</span> nargin &lt; 2
850025     error(<span class="string">'2 inputs required'</span>);
860026 <span class="keyword">end</span>
870027 <span class="keyword">if</span> nargin == 2
880028     MemberString = Field;
890029 <span class="keyword">end</span>
900030
910031 <span class="keyword">if</span> isstruct(FamilyName)
920032     <span class="keyword">if</span> isfield(FamilyName, <span class="string">'FamilyName'</span>)
930033         FamilyName = FamilyName.FamilyName;
940034     <span class="keyword">else</span>
950035         error(<span class="string">'For structure inputs, FamilyName field must exist'</span>);
960036     <span class="keyword">end</span>
970037 <span class="keyword">end</span>
980038
990039 IsTest = [];
1000040 Index = [];
1010041 <span class="keyword">for</span> i = 1:size(FamilyName,1)
1020042     Family = deblank(FamilyName(i,:));
1030043     <span class="keyword">if</span> nargin == 2
1040044         IsTest(i,1) = any(strcmpi(MemberString, <a href="getmemberof.html" class="code" title="function  MemberOfCell = getmemberof(FamilyName, Field)">getmemberof</a>(Family)));
1050045     <span class="keyword">else</span>
1060046         IsTest(i,1) = any(strcmpi(MemberString, <a href="getmemberof.html" class="code" title="function  MemberOfCell = getmemberof(FamilyName, Field)">getmemberof</a>(Family, Field)));
1070047     <span class="keyword">end</span>
1080048     <span class="keyword">if</span> IsTest(i,1) == 1
1090049         Index = [Index; i];
1100050     <span class="keyword">end</span>
1110051 <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> &copy; 2003</address>
113</body>
114</html>
Note: See TracBrowser for help on using the repository browser.