Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In auto generated <code>OpeningFcn</code> callback, if you're using GUIDE You can define variables/fields in <code>handle</code> structure.</p> <p>This is initialization part. The data used by this can be shared across all widgets on the GUI.</p> <p>So, in this callback, for <code>variable_1</code>,<code>variable_2</code>, <code>sum</code>, etc. you can have something like following:</p> <pre><code>handles.variable_1 = 1; handles.variable_1 = 2; handles.sum = handles.variable_1 + handles.variable_1 = 1; % At end update handles structure handles.output = hObject; guidata(hObject, handles); </code></pre> <p>In other callback, say your <code>Button</code> or <code>Edit</code> callback</p> <p>you can update these values as normal like following</p> <pre><code>handles.variable_1 = 12; handles.variable_1 = 23; handles.sum = handles.variable_1 + handles.variable_1 = 1; % Now, at end of callback save the change you made to the structure guidata(hObject,handles) </code></pre> <p>To verify these values type <code>handles</code> at command window.</p> <p>Ref :<strong><em><a href="http://www.mathworks.in/help/matlab/ref/guidata.html" rel="nofollow">Store or retrieve GUI data</a></em></strong> for more details.</p> <p>To use these variables from GUI to other script simple assign them in workspace like <code>assignin('base','variable_1',handles.variable_1);</code> ,etc in any of the callback where <code>variable_1</code> is getting updated.</p> <p>Then, in your m-script you can directly use these variables.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload