title: How can I access data from outside the app class in appdesigner (Matlab)
body: <p>I have created a very simple GUI in appdesigner (Matlab) with one dropdown menu. Additionally, I took the code that got generated (under 'Code View' tab) and pasted that in a normal .m file (because, I want to further add some more contents to this code). My question is how can I access certain variable from this self generated code, so that I can play with that value outside of the main class?</p>
  
  <p>For example:</p>
  
  <p>In App class, for this dropdown menu section, following line of code got generated:</p>
  
  <pre><code>app.ColorDropDown = uidropdown(app.UIFigure);
  app.ColorDropDown.Items = {'Red', 'Blue', 'Yellow'};
  app.ColorDropDown.Position = [277 178 140 22];
  app.ColorDropDown.Value = 'Red';
  </code></pre>
  
  <p><strong>Outside of this app class:</strong> Depending upon the value that was selected in this dropdown menu, I want to capture that in a normal variable, and show some other results based on the color selected</p>
  
  <p>Thanks</p>