title: Using value in GUIDE listbox as variable (MATLAB)
body: <p>I am trying to build a gui to generate some plots using some information contained in the opening function. I am using a listbox to attempt to update those variables, for instance, before I even run the plot loops, I want to select an initial condition from the listbox. However, no matter what selection I make in the listbox, the initial condition always resets to 0. Here is a sort-of explanation of what I am trying to do:</p>
  
  <p>Opening function:</p>
  
  <pre><code>x(i) = 0;
  y(i) = str2double(char(get(handles.edit1, 'String');
  z(i) = 0;
  </code></pre>
  
  <p>Listbox function:</p>
  
  <pre><code>listval = get(handles.listbox1, 'Value');
  
  if (listval == 1)
      set(handles.edit1, 'String', '35')
  
  elseif (listval == 2)
      set(handles.edit1, 'String', '40')
  
  elseif (listval == 3)
      set(handles.edit1, 'String', '45')
  ....
  </code></pre>
  
  <p>I am certain I am calling the listbox values correctly, in that I am passing them to an edit box to display the value, and then calling the value of the edit box as the new value of y(i). However, after removing the semicolons from the assignment statements, I selected the desired value on the listbox, ran the script, but the command window showed that y = 0.</p>
  
  <p>Any advice would be greatly appreciated.</p>