title: Return popupmenu selection in MATLAB using one line of code
body: <p>I have a GUI which uses a selection from a popupmenu in another callback. Is there a way to return the selected value of the popupmenu in only one line without creating any temporary variables? I've tried several solutions, but I've only managed two lines with one temporary variable:</p>
  
  <p>Three lines:</p>
  
  <pre><code>list=get(handles.popupmenu1,'String');
  val=get(handles.popupmenu1,'Value');
  str=list{val};
  </code></pre>
  
  <p>Two lines:</p>
  
  <pre><code>temp=get(handles.popupmenu1,{'String','Value'});
  str=temp{1}{temp{2}};
  </code></pre>
  
  <p>Can anyone shave it down to one?</p>
  
  <p>PS, It's a dynamic menu, so I can't just use <code>get(handles.popupmenu1,'Value')</code> and ignore the string component altogether.</p>