📄 tstrsinv.m
字号:
'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 Help','If the signal at the 1st inport is larger than or equal to the given threshold at the rising edge of the 2nd inport, the counter increases by one. The rising edge of the 3rd port resets the counter to zero.')
set_param([sys,'/','Counter'],...
'Mask Entries','.6\/')
% Finished composite block 'Counter'.
set_param([sys,'/','Counter'],...
'hide name',0,...
'position',[390,153,470,197])
% Subsystem ['Pulses divide',13,'same sample time'].
new_system([sys,'/',['Pulses divide',13,'same sample time']])
set_param([sys,'/',['Pulses divide',13,'same sample time']],'Location',[55,192,283,286])
add_block('built-in/S-Function',[sys,'/',['Pulses divide',13,'same sample time/S-function1']])
set_param([sys,'/',['Pulses divide',13,'same sample time/S-function1']],...
'function name','homopuls',...
'parameters','samp_time, out_divid, offset',...
'position',[40,31,105,59])
add_block('built-in/Outport',[sys,'/',['Pulses divide',13,'same sample time/Outport']])
set_param([sys,'/',['Pulses divide',13,'same sample time/Outport']],...
'position',[160,35,180,55])
add_line([sys,'/',['Pulses divide',13,'same sample time']],[110,45;155,45])
set_param([sys,'/',['Pulses divide',13,'same sample time']],...
'Mask Display','plot(0,0,100,100,x,y);Pulse',...
'Mask Type','Pulse generator')
set_param([sys,'/',['Pulses divide',13,'same sample time']],...
'Mask Dialogue','Vector pulses with sample rate of each pulse as Sample_time / Divider.|Sample time (scalar, sec):|Divider (integer vector):|Offset (same length as Divider):')
set_param([sys,'/',['Pulses divide',13,'same sample time']],...
'Mask Translate','samp_time=@1;out_divid=@2;offset=@3;[x,y]=srcsicon(2);')
set_param([sys,'/',['Pulses divide',13,'same sample time']],...
'Mask Help','This block generates a vector pulse. The output length is the same as the divider vector length. The ith element of the output has the sample time Sample_time/Divider(i). All elements in divider must be integers.')
set_param([sys,'/',['Pulses divide',13,'same sample time']],...
'Mask Entries','1\/N_rs_demo\/.5/N_rs_demo\/')
% Finished composite block ['Pulses divide',13,'same sample time'].
set_param([sys,'/',['Pulses divide',13,'same sample time']],...
'hide name',0,...
'position',[245,138,325,182])
% Subsystem ['Sampled read',13,'from wksp'].
new_system([sys,'/',['Sampled read',13,'from wksp']])
set_param([sys,'/',['Sampled read',13,'from wksp']],'Location',[355,528,737,675])
% Subsystem ['Sampled read',13,'from wksp/Pulses deivide',13,'same sample time1'].
new_system([sys,'/',['Sampled read',13,'from wksp/Pulses deivide',13,'same sample time1']])
set_param([sys,'/',['Sampled read',13,'from wksp/Pulses deivide',13,'same sample time1']],'Location',[55,192,283,286])
add_block('built-in/S-Function',[sys,'/',['Sampled read',13,'from wksp/Pulses deivide',13,'same sample time1/S-function1']])
set_param([sys,'/',['Sampled read',13,'from wksp/Pulses deivide',13,'same sample time1/S-function1']],...
'function name','homopuls',...
'parameters','samp_time, out_divid, offset',...
'position',[40,31,105,59])
add_block('built-in/Outport',[sys,'/',['Sampled read',13,'from wksp/Pulses deivide',13,'same sample time1/Outport']])
set_param([sys,'/',['Sampled read',13,'from wksp/Pulses deivide',13,'same sample time1/Outport']],...
'position',[160,35,180,55])
add_line([sys,'/',['Sampled read',13,'from wksp/Pulses deivide',13,'same sample time1']],[110,45;155,45])
set_param([sys,'/',['Sampled read',13,'from wksp/Pulses deivide',13,'same sample time1']],...
'Mask Display','Vector\nPulse',...
'Mask Type','Pulse generator')
set_param([sys,'/',['Sampled read',13,'from wksp/Pulses deivide',13,'same sample time1']],...
'Mask Dialogue','Vector pulses with sample rate of each pulse as Sample_time ./Divider. |Sample time (scalar, sec):|Divider (integer vector):|Offset (have same dimension as Divider:')
set_param([sys,'/',['Sampled read',13,'from wksp/Pulses deivide',13,'same sample time1']],...
'Mask Translate','samp_time=@1;out_divid=@2;offset=@3;')
set_param([sys,'/',['Sampled read',13,'from wksp/Pulses deivide',13,'same sample time1']],...
'Mask Help','This block generator a vector pulses. The output length is the same as the vector defined in "Divider". The ith element of the output has the sample time Sample_time/Divider(i). All elements in "Divider" must be integers.')
set_param([sys,'/',['Sampled read',13,'from wksp/Pulses deivide',13,'same sample time1']],...
'Mask Entries','ts\/1\/off\/')
% Finished composite block ['Sampled read',13,'from wksp/Pulses deivide',13,'same sample time1'].
set_param([sys,'/',['Sampled read',13,'from wksp/Pulses deivide',13,'same sample time1']],...
'position',[50,56,110,94])
add_block('built-in/Outport',[sys,'/',['Sampled read',13,'from wksp/out_1']])
set_param([sys,'/',['Sampled read',13,'from wksp/out_1']],...
'position',[295,65,315,85])
add_block('built-in/S-Function',[sys,'/',['Sampled read',13,'from wksp/Message source']])
set_param([sys,'/',['Sampled read',13,'from wksp/Message source']],...
'BackGround',5,...
'function name','trigwksp',...
'parameters','var,thd,cyclFlag,ini',...
'Mask Display','Triggered\nread',...
'Mask Type','Read from workspace')
set_param([sys,'/',['Sampled read',13,'from wksp/Message source']],...
'Mask Dialogue','The raising edge of input pulse trigger the block output the next row from the workspace variable.|Read the variable:|Threshold for the input pulse:|Cyclic read variable (1) or amend zeros (0).|Output before first trigger:')
set_param([sys,'/',['Sampled read',13,'from wksp/Message source']],...
'Mask Translate','var=@1;thd=@2;cyclFlag=@3;ini=@4;')
set_param([sys,'/',['Sampled read',13,'from wksp/Message source']],...
'Mask Help','This block reads the data from a workspace variable. The output is refreshed at the raising edge of the input pulse.',...
'Mask Entries','var\/.1\/cyc\/ini\/')
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -