title: Using strmatch in a loop
body: <p>Can I do the something below coded using or without  loop?</p>
  
  <p>Actually I am having a character array comprising of unique words more than <code>5000</code> and other array comprising of approx <code>3000</code> words. I want to search each word in my array named as word in other array named as <code>uniques</code> and wish to create a feature vector i.e. values <code>1</code> if exists and <code>0</code> if doesn't.</p>
  
  <p>I am doing the following..</p>
  
  <pre><code>load 'uniques'  %uniques={'alpha','ok',abc'};
  fid=fopen(myfilename);
  words=textscan(fid,'%s');
  fclose(fid);
  word=words{1,1}; %word={'good','bad',anywhere','countries','ok',done','abc'}
  
  for i=1:size(uniques,2)
  ind=strmatch(word(i), uniques, 'exact');
  end
  </code></pre>
  
  <p>Now, seeing above as examples before <code>uniques</code> and <code>word</code> arays, my system must return <code>0</code> for <code>good</code> as <code>good</code> is not there in <code>uniques</code> and same <code>0</code> values but <code>1</code> for <code>ok</code> because it does exist in <code>uniques</code>. All in all, I must have in the end, <code>{0,0,0,0,1,0,1}</code>  ..</p>
  
  <p>After I run, it gives me <code>ind=[]</code></p>
  
  <p>Please guide</p>