Azzera filtri
Azzera filtri

How can i use a global var with call_back functions?

1 visualizzazione (ultimi 30 giorni)
The problem is: how can i declare a global var, so i can use it on all functions of my guidata?
for example:
function pushbutton5_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
----> cpselect(E,D);
guidata(hObject, handles);
% --- Executes on button press in Inserir.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton4 (see GCBO)
% Invoca duas fotos
echo ImRectOpen off;
-----> global E D;
guidata(hObject, handles);
First, i've ran the pushbutton_callback4 and then pushbutton_callback5. On pushbutton_callback5 global variables (E and D) that were declared on pushbutton_callback4, cant be found.

Risposta accettata

Walter Roberson
Walter Roberson il 3 Nov 2011

Più risposte (0)


Scopri di più su Large Files and Big Data in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by