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 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
function gui_thermocap
global x handles
%%% Création de l'objet Figure
handles(1)=figure('units','pixels',...
'position',[250 250 500 500],...
'color',[0.1 0 0.8],...
'numbertitle','off',...
'name','test_gui',...
'menubar','none',...
'tag','interface');
%%%% Selection des parametres
% Création de l'onglet Paramètres
handles(2)=uicontrol('style','text',...
'units','normalized',...
'position',[0.1 0.96 0.2 0.03],...
'string','Paramètres');
% Création de l'objet x1
handles(3)=uicontrol('style','text',...
'units','normalized',...
'position',[0.05 0.92 0.1 0.03],...
'string','x1');
% Création de la valeur x1
handles(4)=uicontrol('style','edit',...
'units','normalized',...
'position',[0.25 0.92 0.1 0.03]);
% Création de l'objet x2
handles(5)=uicontrol('style','text',...
'units','normalized',...
'position',[0.05 0.92 0.1 0.03],...
'string','x2');
% Création de la valeur x1
handles(6)=uicontrol('style','edit',...
'units','normalized',...
'position',[0.25 0.92 0.1 0.03]);
...
% Création de l'objet calcul
handles(23)=uicontrol('style','pushbutton',...
'units','normalized',...
'position',[0.15 0.52 0.1 0.03],...
'string','Calcul',...
'callback',@calcul,...
'tag','buttoncalcul');
% enregistrement
data.x1=x1;
data.x2=x2;
guidata(gcf,data)
function calcul(objet,event)
global x1 x2 handles
data=guidata(gcbf);
x1=data.x1;
x2=data.x2;
nb_pts=40;
if x1==x2
r=x1;
else
r=linspace(x1,x2,nb_pts);
end |
Partager