title: Use a vector as an index to a matrix
body: <p>I'm writing a MATLAB function to read out data into an n-dimensional array (variable dimension size). I need to be able to access a specific point in the Matrix (to write to it or read it, for example), but I don't know ahead of time how many indexes to specify. </p>
  
  <p>Currently I have a <code>current_point</code> vector which I iterate through to specify each index, and a <code>max_points</code> vector which specifies the size of the array. So, if for example I wanted a 3-dimensional array of size 1000-by-15-by-3, <code>max_points = [1000 15 3]</code>, and <code>current_point</code> iterates from <code>[1, 1, 1]</code> to <code>[1000, 15, 3]</code> (<code>[1, 1, 1]</code> -> <code>[1000, 1, 1]</code> -> <code>[1, 2, 1]</code> -> <code>[1000, 2, 1]</code> ->...). What I'd like to be able to do is feed <code>current_point</code> as an index to the matrix like so:</p>
  
  <pre><code>output_matrix(current_point) = val
  </code></pre>
  
  <p>But apparently something like <code>output_matrix([1 2 3]) = val</code> will just set <code>outputmatrix(1:3) = 30</code>. I can't just use dummy variables because sometimes the matrix will need 3 indexes, other times 4, other times 2, etc, so a vector of variable length is really what I need here. Is there a simple way to use a vector as the points in an index?</p>