title: How can I generate a map key for this vector in MATLAB?
body: <p>I have a function that is looking at a number of elements. Each element is of the form of an 8x1 column vector. Each entry in the vector is an integer less than 1000. Every time I see such a vector, I'd like to add it to a list of "already seen" vectors, after checking to see that the vector is not already on this list. The function will examine on the order of ~100,000 such vectors.</p>
  
  <p>Originally I tried using <code>ismember(v', M, 'rows')</code>, but found this to be very slow. Next I tried:</p>
  
  <pre><code>found = containers.Map('KeyType', 'double', 'ValueType', 'any');
  </code></pre>
  
  <p>Then each time I examine a new vector <code>v</code>, compute:</p>
  
  <pre><code>key = dot(v, [1000000000000000000000 1000000000000000000 1000000000000000 ...
                1000000000000 1000000000 1000000 1000 1]);
  </code></pre>
  
  <p>Then check <code>isKey(found, key)</code>. If the key is not in the container, then <code>found(key) = 1</code>.</p>
  
  <p>This seems like a pretty lousy solution, even though it does run considerably faster than <code>ismember</code>. Any help/suggestions would be greatly appreciated.</p>
  
  <p>EDIT: Perhaps it would be better to use <code>mat2str</code> to generate the key, rather than this silly dot product?</p>