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_bino
global Menu handles
handles(1)=figure('units','pixels',...
'position',[250 250 500 500],...
'color',[0.925 0.913 0.687],...
'numbertitle','off',...
'name','Menu Binom',...
'menubar','none',...
'tag','interface');
handles(3)=uicontrol('style','pushbutton',...
'units','normalized',...
'position',[0.4 0.65 0.1 0.05],...
'string','OK',...
'callback',@graphe,...
'tag','ok');
handles(4)=uicontrol('style','edit',...
'units','normalized',...
'position',[0.6 0.7 0.3 0.05],...
'string','0',...
'tag','v');
handles(5)=uicontrol('style','edit',...
'units','normalized',...
'position',[0.6 0.8 0.3 0.05],...
'string','0',...
'tag','P');
handles(6)=uicontrol('style','edit',...
'units','normalized',...
'position',[0.6 0.9 0.3 0.05],...
'string','0',...
'tag','N');
handles(7) = uimenu(...
'Parent',handles(1),...
'HandleVisibility','callback', ...
'Label','Loi de probabilité');
handles(8) = uimenu(...
'Parent',handles(7),...
'HandleVisibility','callback', ...
'Label','Binomiale', ...
'Callback',
handles(9) = uimenu(...
'Parent',handles(7),...
'HandleVisibility','callback', ...
'Label','Poisson', ...
'Callback',
handles(10) = uimenu(...
'Parent',handles(7),...
'HandleVisibility','callback', ...
'Label','Gamma', ...
'Callback',
end
function graphe(obj,event)
global Menu handles
R=binornd(handles(6),handles(5),handles(4))
[m,k]=binostat(handles(6),handles(5))
y=sum(R)/handles(6)
T=y-(m)
s=sqrt(k/handles(6))
z=T/s
k = subplot ( 'Position' , [ 0.15 0.05 0.7 0.55 ] ) ;
histfit(z)
set(handles(3),'string',num2str(Menu)); |
Partager