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
| function Position_Callback(hObject, eventdata, handles)
% hObject handle to Position (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of Position as text
% str2double(get(hObject,'String')) returns contents of Position
% as a double
function choixbutton_SelectionChangeFcn(hObject,eventdata,handles)
% hObject handle to uipanel1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
selection = get(hObject,'SelectedObject');
switch get(selection,'Tag')
case 'Repartie'
% code piece when radiobutton1 is selected goes here
case 'Localisee'
% code piece when radiobutton2 is selected goes here
% ...
end
% --- Executes on button press in Localisee.
function[]= Localisee_Callback(hObject, eventdata, handles)
% hObject handle to Localisee (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of Localisee
h=get(handles.choixboutton,'SelectedObject');
radio_str=get(h,'string')
if radio_str=='Répartie'
plot(2,2,'ob')
else%if radio_str=='Localisée'
plot(1,1,'ob')
end |
Partager