I'm having several functions (defined in separate files) within a Callback in my GUI, like that:
function myFunction_Callback(hObject, eventdata, handles)
[output] = function1(input);
[output] = function2(input);
[output] = function3(input);
guidata(hObject, handles);
Now, lets say I'm defining function1, and I want to store a local variable in handles. When I do like that:
[output] = function1(input)
localVariable = [1 2 3];
handles.myVariable = localVariable;
handles.myVariable
'disappears' from handles once the function1 is completed. How to make it 'stay' in handles? Do I have to define it as an output and later store in handles like that:
[output, localVariable] = function1(input)
...
localVariable = [1 2 3];
and later
function myFunction_Callback(hObject, eventdata, handles)
[output, handles.myVariable] = function1(input);
[output] = function2(input);
[output] = function3(input);
guidata(hObject, handles);
?? I know this question sounds super stupid and might be unclear, but forgive me, I'm very confused with GUI and handles newbie :) thanks!