📄 tsthamsq.m
字号:
add_line([sys,'/',['Binary error',13,'channel']],[195,80;230,80])
add_line([sys,'/',['Binary error',13,'channel']],[210,80;210,135;270,135])
set_param([sys,'/',['Binary error',13,'channel']],...
'Mask Display','plot(0,0,100,100,x,y);B-error',...
'Mask Type','Add binary errors')
set_param([sys,'/',['Binary error',13,'channel']],...
'Mask Dialogue','The error probability can be a scalar or a vector with the same length as the\ninput vector length.|Error probability:|Input vector length:')
set_param([sys,'/',['Binary error',13,'channel']],...
'Mask Translate','M=@2;P=@1;if length(P)~=M,P=ones(1,M)*P(1);end;[x,y]=chanicon;')
set_param([sys,'/',['Binary error',13,'channel']],...
'Mask Help','This block adds binary errors to transmitted binary signals. The error probability is given in the parameter setting. The first output port outputs the transmitting signal (after adding noise). The second port outputs the errors signal added to the transmitting signal.')
set_param([sys,'/',['Binary error',13,'channel']],...
'Mask Entries','.04\/1\/')
% Finished composite block ['Binary error',13,'channel'].
set_param([sys,'/',['Binary error',13,'channel']],...
'hide name',0,...
'position',[265,43,345,87])
% Subsystem 'Counter'.
new_system([sys,'/','Counter'])
set_param([sys,'/','Counter'],'Location',[128,50,722,374])
add_block('built-in/Constant',[sys,'/','Counter/Constant'])
set_param([sys,'/','Counter/Constant'],...
'ForeGround',3,...
'Value','thld',...
'position',[105,100,135,120])
add_block('built-in/Relational Operator',[sys,'/',['Counter/Relational',13,'Operator1']])
set_param([sys,'/',['Counter/Relational',13,'Operator1']],...
'ForeGround',2,...
'Operator','>',...
'position',[225,53,255,77])
add_block('built-in/Sum',[sys,'/','Counter/Sum'])
set_param([sys,'/','Counter/Sum'],...
'ForeGround',3,...
'position',[295,100,315,120])
add_block('built-in/Switch',[sys,'/','Counter/Switch2'])
set_param([sys,'/','Counter/Switch2'],...
'ForeGround',3,...
'Threshold','eps',...
'position',[345,149,370,181])
add_block('built-in/Inport',[sys,'/','Counter/in_1'])
set_param([sys,'/','Counter/in_1'],...
'position',[15,50,35,70])
add_block('built-in/Inport',[sys,'/','Counter/in_2'])
set_param([sys,'/','Counter/in_2'],...
'Port','2',...
'position',[15,155,35,175])
% Subsystem ['Counter/Rising edge',13,'detector'].
new_system([sys,'/',['Counter/Rising edge',13,'detector']])
set_param([sys,'/',['Counter/Rising edge',13,'detector']],'Location',[303,485,692,659])
add_block('built-in/Outport',[sys,'/',['Counter/Rising edge',13,'detector/out_1']])
set_param([sys,'/',['Counter/Rising edge',13,'detector/out_1']],...
'position',[340,25,360,45])
add_block('built-in/Relational Operator',[sys,'/',['Counter/Rising edge',13,'detector/Relational',13,'Operator1']])
set_param([sys,'/',['Counter/Rising edge',13,'detector/Relational',13,'Operator1']],...
'position',[200,88,230,112])
add_block('built-in/Relational Operator',[sys,'/',['Counter/Rising edge',13,'detector/Relational',13,'Operator2']])
set_param([sys,'/',['Counter/Rising edge',13,'detector/Relational',13,'Operator2']],...
'Operator','>',...
'position',[265,23,295,47])
add_block('built-in/Constant',[sys,'/',['Counter/Rising edge',13,'detector/one1']])
set_param([sys,'/',['Counter/Rising edge',13,'detector/one1']],...
'Value','thld',...
'position',[30,135,60,155])
add_block('built-in/Memory',[sys,'/',['Counter/Rising edge',13,'detector/Memory1']])
set_param([sys,'/',['Counter/Rising edge',13,'detector/Memory1']],...
'position',[125,80,165,110])
add_block('built-in/Inport',[sys,'/',['Counter/Rising edge',13,'detector/in_1']])
set_param([sys,'/',['Counter/Rising edge',13,'detector/in_1']],...
'position',[10,15,30,35])
add_block('built-in/Relational Operator',[sys,'/',['Counter/Rising edge',13,'detector/Relational',13,'Operator']])
set_param([sys,'/',['Counter/Rising edge',13,'detector/Relational',13,'Operator']],...
'position',[135,18,165,42])
add_line([sys,'/',['Counter/Rising edge',13,'detector']],[35,25;130,25])
add_line([sys,'/',['Counter/Rising edge',13,'detector']],[45,25;45,95;120,95])
add_line([sys,'/',['Counter/Rising edge',13,'detector']],[170,95;195,95])
add_line([sys,'/',['Counter/Rising edge',13,'detector']],[65,145;100,145;100,35;130,35])
add_line([sys,'/',['Counter/Rising edge',13,'detector']],[100,145;180,145;180,105;195,105])
add_line([sys,'/',['Counter/Rising edge',13,'detector']],[170,30;260,30])
add_line([sys,'/',['Counter/Rising edge',13,'detector']],[235,100;240,100;240,40;260,40])
add_line([sys,'/',['Counter/Rising edge',13,'detector']],[300,35;335,35])
set_param([sys,'/',['Counter/Rising edge',13,'detector']],...
'Mask Display','Edge\ndetector',...
'Mask Type','Edge Detection',...
'Mask Dialogue','Rising edge detection:|Threshold:',...
'Mask Translate','thld=@1;')
set_param([sys,'/',['Counter/Rising edge',13,'detector']],...
'Mask Help','When the input signal rising edge passed the given shreshold, this block outputs one, otherwise outputs zero.',...
'Mask Entries','thld\/')
% Finished composite block ['Counter/Rising edge',13,'detector'].
set_param([sys,'/',['Counter/Rising edge',13,'detector']],...
'ForeGround',4,...
'position',[80,148,140,182])
add_block('built-in/Outport',[sys,'/','Counter/out_1'])
set_param([sys,'/','Counter/out_1'],...
'position',[550,145,570,165])
add_block('built-in/Switch',[sys,'/','Counter/Switch3'])
set_param([sys,'/','Counter/Switch3'],...
'ForeGround',3,...
'Threshold','eps',...
'position',[470,139,495,171])
add_block('built-in/Memory',[sys,'/','Counter/Memory3'])
set_param([sys,'/','Counter/Memory3'],...
'orientation',2,...
'ForeGround',3,...
'position',[400,205,440,235])
add_block('built-in/Inport',[sys,'/','Counter/in_3'])
set_param([sys,'/','Counter/in_3'],...
'Port','3',...
'position',[315,60,335,80])
% Subsystem ['Counter/Rising edge',13,'detector1'].
new_system([sys,'/',['Counter/Rising edge',13,'detector1']])
set_param([sys,'/',['Counter/Rising edge',13,'detector1']],'Location',[303,485,692,659])
add_block('built-in/Relational Operator',[sys,'/',['Counter/Rising edge',13,'detector1/Relational',13,'Operator']])
set_param([sys,'/',['Counter/Rising edge',13,'detector1/Relational',13,'Operator']],...
'position',[135,18,165,42])
add_block('built-in/Inport',[sys,'/',['Counter/Rising edge',13,'detector1/in_1']])
set_param([sys,'/',['Counter/Rising edge',13,'detector1/in_1']],...
'position',[10,15,30,35])
add_block('built-in/Memory',[sys,'/',['Counter/Rising edge',13,'detector1/Memory1']])
set_param([sys,'/',['Counter/Rising edge',13,'detector1/Memory1']],...
'position',[125,80,165,110])
add_block('built-in/Constant',[sys,'/',['Counter/Rising edge',13,'detector1/one1']])
set_param([sys,'/',['Counter/Rising edge',13,'detector1/one1']],...
'Value','thld',...
'position',[30,135,60,155])
add_block('built-in/Relational Operator',[sys,'/',['Counter/Rising edge',13,'detector1/Relational',13,'Operator2']])
set_param([sys,'/',['Counter/Rising edge',13,'detector1/Relational',13,'Operator2']],...
'Operator','>',...
'position',[265,23,295,47])
add_block('built-in/Relational Operator',[sys,'/',['Counter/Rising edge',13,'detector1/Relational',13,'Operator1']])
set_param([sys,'/',['Counter/Rising edge',13,'detector1/Relational',13,'Operator1']],...
'position',[200,88,230,112])
add_block('built-in/Outport',[sys,'/',['Counter/Rising edge',13,'detector1/out_1']])
set_param([sys,'/',['Counter/Rising edge',13,'detector1/out_1']],...
'position',[340,25,360,45])
add_line([sys,'/',['Counter/Rising edge',13,'detector1']],[300,35;335,35])
add_line([sys,'/',['Counter/Rising edge',13,'detector1']],[235,100;240,100;240,40;260,40])
add_line([sys,'/',['Counter/Rising edge',13,'detector1']],[170,30;260,30])
add_line([sys,'/',['Counter/Rising edge',13,'detector1']],[65,145;100,145;100,35;130,35])
add_line([sys,'/',['Counter/Rising edge',13,'detector1']],[100,145;180,145;180,105;195,105])
add_line([sys,'/',['Counter/Rising edge',13,'detector1']],[170,95;195,95])
add_line([sys,'/',['Counter/Rising edge',13,'detector1']],[35,25;130,25])
add_line([sys,'/',['Counter/Rising edge',13,'detector1']],[45,25;45,95;120,95])
set_param([sys,'/',['Counter/Rising edge',13,'detector1']],...
'Mask Display','Edge\ndetector',...
'Mask Type','Edge Detection',...
'Mask Dialogue','Rising edge detection:|Threshold:',...
'Mask Translate','thld=@1;')
set_param([sys,'/',['Counter/Rising edge',13,'detector1']],...
'Mask Help','When the input signal rising edge passed the given shreshold, this block outputs one, otherwise outputs zero.',...
'Mask Entries','thld\/')
% Finished composite block ['Counter/Rising edge',13,'detector1'].
set_param([sys,'/',['Counter/Rising edge',13,'detector1']],...
'ForeGround',4,...
'position',[375,53,435,87])
add_line([sys,'/','Counter'],[440,70;450,70;450,155;465,155])
add_line([sys,'/','Counter'],[395,220;275,220;275,175;340,175])
add_line([sys,'/','Counter'],[275,175;275,115;290,115])
add_line([sys,'/','Counter'],[145,165;340,165])
add_line([sys,'/','Counter'],[260,65;275,65;275,105;290,105])
add_line([sys,'/','Counter'],[140,110;190,110;190,70;220,70])
add_line([sys,'/','Counter'],[320,110;330,110;340,155])
add_line([sys,'/','Counter'],[40,60;220,60])
add_line([sys,'/','Counter'],[40,165;75,165])
add_line([sys,'/','Counter'],[340,70;370,70])
add_line([sys,'/','Counter'],[375,165;465,165])
add_line([sys,'/','Counter'],[500,155;545,155])
add_line([sys,'/','Counter'],[520,155;520,220;445,220])
set_param([sys,'/','Counter'],...
'Mask Display','plot(0,0,100,100,x,y,v,w);Counter',...
'Mask Type','Resettable number counter')
set_param([sys,'/','Counter'],...
'Mask Dialogue','If the 1st inport value is larger than the threshold, the counter increases one at the rising edge of the 2nd inport pulse.|Threshold:')
set_param([sys,'/','Counter'],...
'Mask Translate','thld=@1;[v,w]=trigicon(0,50,get_param(gcb,''orientation''),2);[x,y]=trigicon(0,20,get_param(gcb,''orientation''),2);')
set_param([sys,'/','Counter'],...
'Mask He
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -