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
| function uipushtool8_ClickedCallback(hObject, eventdata, handles)
% hObject handle to uipushtool8 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
nb_de_subplot = length(findall(gcf,'type','axes'));
list_gca = findall(gcf,'type','axes');
if nb_de_subplot == 1
h_title = get(gca,'title'); %sauvgarder les titres de la figure
title_current = get(h_title ,'string'); %sauvgarder les titres de la figure
h = get(gca,'child');
yy = get(h, 'ydata');
S = yy;
figure('name',[title_current]);
plot(S)
title([title_current],'color','red','FontName', 'Segoe UI');
xlabel('Time (unit: sampling time)');
ylabel('Amplitude');
grid on;
elseif nb_de_subplot > 1
for i=1:nb_de_subplot
ha = list_gca(i);
h_title = get(ha,'title'); %sauvgarder les titres de la figure
title_current = get(h_title ,'string'); %sauvgarder les titres de la figure
h = get(ha,'child');
yy = get(h, 'ydata');
S = yy;
figure('name',[title_current]);
plot(S)
title([title_current],'color','red','FontName', 'Segoe UI');
xlabel('Time (unit: sampling time)');
ylabel('Amplitude');
grid on;
end
end |
Partager