title: How can I group variables from a mat file by name and collect them in a structure?
body: <p>I'm reading in a mat file which has variables with a counter e.g. <code>a1</code>, <code>a2</code>, <code>a3</code>, <code>b</code>, <code>c1</code> and <code>c2</code>.</p>
  
  <p>I want to put the data into a structure with field names "a", "b" and "c" where 
  <code>a=[a1;a2;a3]</code>, <code>b=b</code> and <code>c = [c1; c2]</code>. </p>
  
  <p>The algorithm needs to be able to do this, without knowing what the maximum value of the counter of each variable is. How can I do this?</p>