title: Hash tables in MATLAB
body: <p>Does MATLAB have any support for hash tables?</p>
  
  <hr>
  
  <h2>Some background</h2>
  
  <p>I am working on a problem in Matlab that requires a scale-space representation of an image. To do this I create a 2-D Gaussian filter with variance <code>sigma*s^k</code> for <code>k</code> in some range., and then I use each one in turn to filter the image.  Now, I want some sort of mapping from <code>k</code> to the filtered image.</p>
  
  <p>If <code>k</code> were always an integer, I'd simply create a 3D array such that:</p>
  
  <pre><code>arr[k] = &lt;image filtered with k-th guassian&gt;
  </code></pre>
  
  <p>However, <code>k</code> is not necessarily an integer, so I can't do this.  What I thought of doing was keeping an array of <code>k</code>s such that:</p>
  
  <pre><code>arr[find(array_of_ks_ = k)] = &lt;image filtered with k-th guassian&gt;
  </code></pre>
  
  <p>Which seems pretty good at first thought, except I will be doing this lookup potentially a few thousand times with about 20 or 30 values of <code>k</code>, and I fear that this will hurt performance.  </p>
  
  <p>I wonder if I wouldn't be better served doing this with a hash table of some sort so that I would have a lookup time that is O(1) instead of O(n).</p>
  
  <hr>
  
  <p>Now, I know that I shouldn't optimize prematurely, and I may not have this problem at all, but remember, this is just the background, and there may be cases where this is really the best solution, regardless of whether it is the best solution for <em>my</em> problem.</p>