bonjour,

je souhaite définir 4 variables qui seront connues dans tout le fichier.m de mon interface graphique. Mais ceci ne marche pas à l'exterieur des fonctions Callback.

Est ce quelqu'un à une idée?

merci!!
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
global a b c d 
 
 
function r1_Callback(hObject, eventdata, handles)
% hObject    handle to r1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% set(handles.r1,'value')==1
 
 
if get(handles.r1,'value')
    a=1;
    b=0;
    c=0;
    d=0;
end
 
 
 
function r2_Callback(hObject, eventdata, handles)
% hObject    handle to r2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
 
if get(handles.r2,'value')
    a=0;
    b=1;
    c=0;
    d=0;
end
 
 
function r3_Callback(hObject, eventdata, handles)
% hObject    handle to r3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
 
if get(handles.r3,'value')
    a=0;
    b=0;
    c=1;
    d=0;
end
 
 
function r4_Callback(hObject, eventdata, handles)
% hObject    handle to r4 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
 
if get(handles.r4,'value')
    a=0;
    b=0;
    c=0;
    d=1;
end