title: How can I display and access structure array contents in MATLAB?
body: <p>Firstly, I have the user input their own text files consisting of states, capitals, and populations and I put all of these values into a structure array using the following code:</p>
  
  <pre><code>clear
  clc
  %Part A
  textfile=input('What is the name of your text file?\n','s');
  fid=fopen(textfile);
  file=textscan(fid,'%s %s %f','delimiter',',');
  State=file{1}
  Capital=file{2}
  Population=file{3}
  regions=struct('State',State,...
      'Capital',Capital,...
      'Population',Population)
  fclose(fid);
  </code></pre>
  
  <p>My first question: is it possible to display all of the <em>values</em> in the structure? Displaying the structure array just gives me this:</p>
  
  <pre><code>50x1 struct array with fields:
  
      State
      Capital
      Population
  </code></pre>
  
  <p>And my second question: is it possible for me to access information in this structure by trying to find, for example, <code>'California'</code> only?</p>