1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| function graphe_vitesse(hObj,Event)
cla(axes_v)
%Récupération des valeurs
d1=getappdata(gcbf,'valeur_de_d1');
v1=getappdata(gcbf,'valeur_de_v1');
handles = guidata(gcbf);
hplot = get(hObj,'UserData');
if isempty(hplot)
axes(handles.axes_v);
hplot = plot(handles.axes_v,d1,v1,'b');
hold(handles.axes_v,'on')
grid(handles.axes_v,'on')
set(hObj,'UserData',hplot);
else
if strcmp(get(hplot,'Visible'),'on'), set(hplot,'Visible','off')
else set(hplot,'Visible','on')
end
end
guidata(gcbf,handles) |
Partager