-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathshili60.m
73 lines (73 loc) · 2.02 KB
/
shili60.m
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
72
73
h0=figure('toolbar','none',...
'position',[198 56 350 468],...
'name','ʵÀý60');
h1=axes('parent',h0,...
'position',[0.25 0.45 0.5 0.5],...
'visible','off');
str1='µ±Ç°×èÄá±È£½';
z=0.52;
t=0:0.1:10;
y=step(1,[1 2*z 1],t);
hline=plot(t,y);
grid on
r1=uicontrol('parent',h0,...
'units','points',...
'tag','r1',...
'style','radio',...
'string','grid on',...
'position',[30 120 60 20],...
'backgroundcolor',[0.75 0.75 0.75],...
'value',1,...
'callback',[...
'grid on,',...
'set(r1,''value'',1);,',...
'set(r2,''value'',0)']);
r2=uicontrol('parent',h0,...
'units','points',...
'tag','r2',...
'style','radio',...
'string','grid on',...
'position',[30 95 60 20],...
'backgroundcolor',[0.75 0.75 0.75],...
'value',0,...
'callback',[...
'grid off,',...
'set(r2,''value'',1);,',...
'set(r1,''value'',0)']);
s1=uicontrol('parent',h0,...
'units','points',...
'tag','s1',...
'style','slider',...
'value',z,...
'position',[100 95 150 20],...
'backgroundcolor',[0.75 0.75 0.75],...
'max',1,...
'min',0,...
'callback',[...
'z=get(s1,''value'');,',...
'set(t1,''string'',[str1,sprintf(''%1.4g\'',z)]);,',...
'delete(hline),',...
'y=step(1,[1 2*z 1],t);,',...
'hline=plot(t,y);,',...
'if get(r1,''value'')==1,',...
'grid on,',...
'end,',...
'if get(r2,''value'')==1,',...
'grid off,',...
'end']);
t1=uicontrol('parent',h0,...
'units','points',...
'tag','t1',...
'style','text',...
'string',[str1,sprintf('%1.4g\',z)],...
'position',[100 120 150 20],...
'backgroundcolor',[0.75 0.75 0.75]);
b1=uicontrol('parent',h0,...
'units','points',...
'tag','b1',...
'style','pushbutton',...
'string','¹Ø±Õ',...
'position',[80 50 80 30],...
'backgroundcolor',[0.75 0.75 0.75],...
'fontsize',15,...
'callback','close');