title: Different combinations of getting a total number with x amount of different smaller numbers MATLAB
body: <p>im basically trying to create a list that represents the different ways "change" (as in money) can be given my example is this</p>
  
  <pre><code> printCells(exchange([1,3,10],20))
  </code></pre>
  
  <p>and have the output be </p>
  
  <pre><code>ans =
  &lt;0,0,2&gt;
  &lt;1,3,1&gt;
  &lt;2,6,0&gt;
  &lt;4,2,1&gt;
  &lt;5,5,0&gt;
  &lt;7,1,1&gt;
  &lt;8,4,0&gt;
  &lt;10,0,1&gt;
  &lt;11,3,0&gt;
  &lt;14,2,0&gt;
  &lt;17,1,0&gt;
  &lt;20,0,0&gt;
  </code></pre>
  
  <p>The cells in the output represent how many times each indicie is used in that combination.  Im trying to use recursion with this and i really don't know where to start</p>
  
  <p>Thanks in advance,</p>