title: MATLAB - Is there a way to do a string compare using multiple strings
body: <p>I have a list of strings that I am looking for in a pdb</p>
  
  <pre><code>X1 = ['N' 'CA' 'CB' 'CG1']%Isoleucine
  </code></pre>
  
  <p>I want to compare these strings to the atoms as so:</p>
  
  <pre><code>atoms = find(strcmp({pdb.Model.Atom(:).resName}, 'ILE') &amp; ...
                 (strcmp({pdb.Model.Atom(:).AtomName}, 'N') |...
                  strcmp({pdb.Model.Atom(:).AtomName}, 'CA') | ...
                  strcmp({pdb.Model.Atom(:).AtomName}, 'CB') | ...
                  strcmp({pdb.Model.Atom(:).AtomName}, 'CG1')))
  </code></pre>
  
  <p>Is there a more concise way to do this? Also is there a way for strcmp to do an exact match? not just if it contains the string?</p>
  
  <p>EDIT:</p>
  
  <p>A more concrete example:</p>
  
  <p>I want to be able to do this:</p>
  
  <pre><code>strcmp(['hello' 'world'], ['hello' 'world' 'this' 'is' 'a' 'test'])
  </code></pre>
  
  <p>and it returns whether it matched with hello or world. This instead returns a zero saying that it can't find this array <code>['hello' 'world']</code> in <code>['hello' 'world' 'this' 'is' 'a' 'test']</code>.</p>
  
  <p>Essentially I just want to know if 'hello' and 'world' are in the larger array instead of checking if it contains both 'hello' and 'world' in the same row</p>