title: How to create a generic structure in MATLAB?
body: <p>I'm currently writing a program that basically logs data from multiple peripherals. Since I'm logging the same data from each peripheral, I saw this as a good opportunity to encapsulate this data in a structure. I originally envisioned doing this with a "C" style structure, but when I dug into MATLAB's documentation, I realized the syntax is quite different.</p>
  
  <p>To be more specific, I need - in MATLAB's conventions - a 1-by-6 structure. If I were using C, I would simply define a structure prototype, and create as many instances of it as I needed. Ideally, this allows me to cleanly organize my code. </p>
  
  <p>However, MATLAB doesn't seem to provide this capability. For instance, this is one way I saw how to do what I want:</p>
  
  <pre><code>patient.name = 'John Doe';
  patient.billing = 1;
  
  %Create a second "instance"
  patient.name(2) = 'Someone else';
  patient.billing(2) = 2;
  </code></pre>
  
  <p>The method above does work, being that I can add as many instances as I want. Still, I'm wondering if I could simply define a generic structure with the fields I already need? If I can, this would allow me to better distinguish between the different peripherals while maintaining cleaner and easier to follow code.</p>
  
  <p>Any constructive input is appreciated.</p>