📄 sw.m~
字号:
set(gcf,'Renderer','OpenGL','Position',[20 60 780 540],'ResizeFcn','onfigure','name','Sliding Window Simulation');
clf;
hfleft=uicontrol('Style','frame');
hfmid=uicontrol('Style','frame');
hslidebar = uicontrol('Style', 'slider', 'Value', 0, 'Callback','onslidebar');
slidingaxes=axes;
xlabel('Time');
htsender=uicontrol('Style','text','String','Send');
htreceiver=uicontrol('Style','text','String','Receive');
%xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hrstopandwait=uicontrol('Style','radiobutton','String','Stop and Wait','Max',100,'Min',1,'Value',100,'Callback','onstopandwait');
hrgobackn=uicontrol('Style','radiobutton','String','Go back N','Max',100,'Min',1,'Value', 1,'Callback','ongobackn');
hrselectiverepeat=uicontrol('Style','radiobutton','String','Selective Repeat','Max',100,'Min',1,'Value', 1,'Callback','onseletiverepeat');
%xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
htamas=uicontrol('Style','text','String','a=T_prop/T_tx');
htploss=uicontrol('Style','text','String','Loss Prob.');
htsws=uicontrol('Style','text','String','SWS');
heamas=uicontrol('Style','edit','String','0.5');
heploss=uicontrol('Style','edit','String','0.2');
hesws=uicontrol('Style','edit','String','5');
%htext6=uicontrol('Style','text','String','Receiver');
hbstart=uicontrol('Style','pushbutton','String','Start','Callback','onstart');
hbpause=uicontrol('Style','pushbutton','String','Pause','Callback','onpause','Enable','off');
hbstop=uicontrol('Style','pushbutton','String','Stop','Callback','onstop','Enable','off');
efficientaxes=axes;
xlabel('T_p_r_o_p/T_t_x');
ylabel('Efficiency');
hrstopandwait2=uicontrol('Style','radiobutton','String','Stop and Wait', ...
'Max',100,'Min',1,'Value',100,'Callback','onstopandwait2');
hrgobackn2=uicontrol('Style','radiobutton','String','Go back N', ...
'Max',100,'Min',1,'Value', 1,'Callback','ongobackn2');
htamasmax=uicontrol('Style','text','String','a=T_prop/T_tx (max)');
htamasmin=uicontrol('Style','text','String','a=T_prop/T_tx (min)');
htplossr=uicontrol('Style','text','String','Loss Prob. (red)');
htplossb=uicontrol('Style','text','String','Loss Prob. (green)');
htplossk=uicontrol('Style','text','String','Loss Prob. (black)');
htsws2=uicontrol('Style','text','String','SWS');
heamasmax=uicontrol('Style','edit','String','10');
heamasmin=uicontrol('Style','edit','String','0.1');
heplossr=uicontrol('Style','edit','String','0.4');
heplossb=uicontrol('Style','edit','String','0.2');
heplossk=uicontrol('Style','edit','String','0');
hesws2=uicontrol('Style','edit','String','8');
hbsimulation=uicontrol('Style','pushbutton','String','Simulation','Callback','onsimulation','Enable','on');
onfigure;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -