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
| fig1=figure;
%Affichage Masse bille
text01 = uicontrol( fig1 , 'style' , 'text' , 'position' , [100,250,170,30] ,...
'string' , 'Masse bille mb' , 'fontsize' , 15 , 'BackGroundcolor', 'w');
texte2=uicontrol(fig1,'Style','text','String',0,'Position', [140,220,80,20],'BackGroundcolor','r');
slid2=uicontrol(fig1,'style','slider','position', [100,200,150,20] , 'Min' , 0 , 'Max' , 1 , ...
'callback' , 'set(texte2,''String'', get(slid2 , ''value'' ))', 'BackGroundColor', 'r' );
%Affichage Longueur poutre
text02 = uicontrol( fig1 , 'style' , 'text' , 'position' , [100,140,170,30] ,...
'string' , 'Longueur poutre' , 'fontsize' , 15 , 'BackGroundcolor', 'g');
texte3=uicontrol(fig1,'Style','text','String',0,'Position', [140,110,80,20],'BackGroundcolor','r');
slid3=uicontrol(fig1,'style','slider','position', [100,90,150,20] , 'Min' , 0 , 'Max' , 1 , ...
'callback' , 'set(texte3,''String'', get(slid3 , ''value'' ))', 'BackGroundColor', 'r' );
%Affichage Push Button2
bp1= uicontrol ( fig1 , 'style' , 'push' , 'position' , [100, 350, 60, 30 ] ,...
'string' , 'Début' , 'callback' , @Test2 )
function Test2 (slid2,slid3)
mb=get(slid2,'value');
L=get(slid3,'value');
E=linspace(0,100,80);
i=1:length(E)
%Calcul de F
F(i)=(E(i)*5*(1+L)*mb);
figure
z1 = subplot ( 'Position' , [ .05 .1 .4 .4 ] ) ;
plot ( E,F ) |
Partager