title: Copy a data from a file into a structure
body: <p>I need help in designing a data structure to store the storm data from the file. I am going to use these field names: code, amount, duration, and intensity. The intensity is the rainfall amount divided by the duration.(what should I do to in order to calculate the intensity?) I loaded the data into the variable "mydata", then copied my data into a vector of structs called "vecdata".</p>
  
  <p>My final vector of structures should have the same number of elements as the number of rows in the data file. Additionally, it should have the 4 fields with the field names I mentioned above.</p>
  
  <pre><code>% Creating an example data file 
  anum = randi([3,10]);
  thedata = [randi([1,350],anum,1),rand(anum,1)*5,rand(anum,1)*15];
  save mydata.dat thedata -ascii
  clear
  
  %  loaded the data using the load function into "mydata":
  mydata = load('mydata.dat') 
  
  % Tried to copy the data from "mydata" into a vector of structures called "vecdata":
  
  vecdata = [struct('code','amount','duration','intensity')];
  </code></pre>
  
  <p>This is a very general question. How can I copy the data from the file above? Rows of mydata must match the # of elements in vecdata. How do I check this?</p>