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
| %%%%%%%%%%%%%%%%%%%%%%%%%%%
%Début Fonction Principale%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
function newtestgraph2
%création de la figure
figure('units','pixels','position',[250 250 1000 150],'numbertitle',...,
'off','name','testrécup','tag','interface');
%création de l'objet Pushbutton go!!
u1=uicontrol ('style','pushbutton','units',...,
'normalized','position',[0.6 0.5 0.1 0.05],...,
'string','go!!','callback',@sig,'tag','recup_data');
%axes
axes('units','normalized','position',[0 0.65 0.5 0.3]);
axes('units','normalized','position',[0 0.3 0.5 0.3]);
tab=[0 0 0]; %initialisation de la variable contenant la base de temps, le 1er %signal et le deuxième signal
setappdata(gcf,'donnees_tab',tab);%enregistrement de la variable
%%%%%%%%%%%%%%%%%%%%%%%%%
%Fin Fonction Principale%
%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%
%Début Sous-Fonction Sig%
%%%%%%%%%%%%%%%%%%%%%%%%%
function sig(obj,event)
tab=getappdata(gcbf,'donnees_tab');
f=1;
t=0:0.01:1;
sig1=cos(2*pi*f*t);%1er signal
sig2=cos(2*pi*f*t);%2ème signal
tab=[t sig1 sig2];
h=findobj('parent',gcbf,'style','text','tag','recup_data');
set(h,tab);
setappdata(gcbf,'donnees_tab',tab);
A=getappdata(gcbf,'donnée_tab') |
Partager