📄 extrid.m
字号:
add_block('built-in/S-Function',[sys,'/',['Box-Jenkins',13,'model estimator/S-function',13,'block ']])
set_param([sys,'/',['Box-Jenkins',13,'model estimator/S-function',13,'block ']],...
'function name','sfunid',...
'parameters','order,npts,HowOften,offset,ts,method',...
'position',[205,80,260,120])
add_block('built-in/Inport',[sys,'/',['Box-Jenkins',13,'model estimator/system input']])
set_param([sys,'/',['Box-Jenkins',13,'model estimator/system input']],...
'position',[55,40,75,60])
add_line([sys,'/',['Box-Jenkins',13,'model estimator']],[165,100;200,100])
add_line([sys,'/',['Box-Jenkins',13,'model estimator']],[80,100;125,100])
add_line([sys,'/',['Box-Jenkins',13,'model estimator']],[80,50;110,50;110,90;125,90])
add_line([sys,'/',['Box-Jenkins',13,'model estimator']],[80,150;110,150;110,110;125,110])
set_param([sys,'/',['Box-Jenkins',13,'model estimator']],...
'Mask Display','BJ',...
'Mask Type','BJ')
set_param([sys,'/',['Box-Jenkins',13,'model estimator']],...
'Mask Dialogue','Box-Jenkins model estimator.\nHook input 1 to system input.\nHook input 2 to system output.|Length of buffer:|Orders of model [na nc nd nf nk]|Calculate after how many points:|Sample time:')
set_param([sys,'/',['Box-Jenkins',13,'model estimator']],...
'Mask Translate','method = ''bj''; npts=@1; order=@2; HowOften=@3; ts=@4(1); if length(@4) > 1, offset = @4(2), else, offset = 0; end')
set_param([sys,'/',['Box-Jenkins',13,'model estimator']],...
'Mask Help','Hook the system''s input to the first port of this block and the system''s output to second port. The input noise, which is optional, may be hooked to input 3.\nResults are displayed as the estimated output versus the true output in graphical form. Use signals with high harmonic content for best results. ')
set_param([sys,'/',['Box-Jenkins',13,'model estimator']],...
'Mask Entries','256\/[3 3 3 3 0]\/64\/0.05\/')
% Finished composite block ['Box-Jenkins',13,'model estimator'].
set_param([sys,'/',['Box-Jenkins',13,'model estimator']],...
'Drop Shadow',4,...
'position',[335,197,380,253])
add_block('built-in/Note',[sys,'/',['System Identification Toolbox',13,'model estimators. For more information ',13,'unmask these blocks and look at the ',13,'S-function: sfunid.m.',13,'See also the corresponding toolbox ',13,'help entries.']])
set_param([sys,'/',['System Identification Toolbox',13,'model estimators. For more information ',13,'unmask these blocks and look at the ',13,'S-function: sfunid.m.',13,'See also the corresponding toolbox ',13,'help entries.']],...
'position',[245,5,250,10])
% Subsystem ['AutoRegressive',13,'model estimator'].
new_system([sys,'/',['AutoRegressive',13,'model estimator']])
set_param([sys,'/',['AutoRegressive',13,'model estimator']],'Location',[0,0,371,185])
add_block('built-in/Inport',[sys,'/',['AutoRegressive',13,'model estimator/input noise']])
set_param([sys,'/',['AutoRegressive',13,'model estimator/input noise']],...
'Port','2',...
'position',[60,120,80,140])
add_block('built-in/Mux',[sys,'/',['AutoRegressive',13,'model estimator/Mux']])
set_param([sys,'/',['AutoRegressive',13,'model estimator/Mux']],...
'inputs','3',...
'position',[140,57,170,123])
add_block('built-in/Inport',[sys,'/',['AutoRegressive',13,'model estimator/system output']])
set_param([sys,'/',['AutoRegressive',13,'model estimator/system output']],...
'position',[55,80,75,100])
add_block('built-in/S-Function',[sys,'/',['AutoRegressive',13,'model estimator/S-function',13,'block ']])
set_param([sys,'/',['AutoRegressive',13,'model estimator/S-function',13,'block ']],...
'function name','sfunid',...
'parameters','order,npts,HowOften,offset,ts,method',...
'position',[205,70,260,110])
add_line([sys,'/',['AutoRegressive',13,'model estimator']],[80,90;135,90])
add_line([sys,'/',['AutoRegressive',13,'model estimator']],[175,90;200,90])
add_line([sys,'/',['AutoRegressive',13,'model estimator']],[85,130;115,130;115,110;135,110])
set_param([sys,'/',['AutoRegressive',13,'model estimator']],...
'Mask Display','AR',...
'Mask Type','AR')
set_param([sys,'/',['AutoRegressive',13,'model estimator']],...
'Mask Dialogue','Autoregressive model estimator.\nHook input 1 to system input.\nHook input 2 to the system''s noise input.|Length of buffer:|Orders of model [na]:|Calculate after how many points:|Sample time:')
set_param([sys,'/',['AutoRegressive',13,'model estimator']],...
'Mask Translate','method = ''ar''; npts=@1; order=@2; HowOften=@3; ts=@4(1); if length(@4) > 1, offset = @4(2), else, offset = 0; end')
set_param([sys,'/',['AutoRegressive',13,'model estimator']],...
'Mask Help','Hook the system''s output to the first port of this block and the system noise to the second port.\nResults are displayed as the estimated output versus the true output in graphical form.')
set_param([sys,'/',['AutoRegressive',13,'model estimator']],...
'Mask Entries','256\/3\/64\/0.05\/')
% Finished composite block ['AutoRegressive',13,'model estimator'].
set_param([sys,'/',['AutoRegressive',13,'model estimator']],...
'Drop Shadow',4,...
'position',[130,90,180,145])
% Subsystem ['AutoRegressive ',13,'with eXternal input',13,'model estimator'].
new_system([sys,'/',['AutoRegressive ',13,'with eXternal input',13,'model estimator']])
set_param([sys,'/',['AutoRegressive ',13,'with eXternal input',13,'model estimator']],'Location',[0,0,371,185])
add_block('built-in/Inport',[sys,'/',['AutoRegressive ',13,'with eXternal input',13,'model estimator/system input']])
set_param([sys,'/',['AutoRegressive ',13,'with eXternal input',13,'model estimator/system input']],...
'position',[55,40,75,60])
add_block('built-in/S-Function',[sys,'/',['AutoRegressive ',13,'with eXternal input',13,'model estimator/S-function',13,'block ']])
set_param([sys,'/',['AutoRegressive ',13,'with eXternal input',13,'model estimator/S-function',13,'block ']],...
'function name','sfunid',...
'parameters','order,npts,HowOften,offset,ts,method',...
'position',[205,80,260,120])
add_block('built-in/Inport',[sys,'/',['AutoRegressive ',13,'with eXternal input',13,'model estimator/system output']])
set_param([sys,'/',['AutoRegressive ',13,'with eXternal input',13,'model estimator/system output']],...
'Port','2',...
'position',[55,90,75,110])
add_block('built-in/Mux',[sys,'/',['AutoRegressive ',13,'with eXternal input',13,'model estimator/Mux']])
set_param([sys,'/',['AutoRegressive ',13,'with eXternal input',13,'model estimator/Mux']],...
'inputs','3',...
'position',[130,82,160,118])
add_block('built-in/Inport',[sys,'/',['AutoRegressive ',13,'with eXternal input',13,'model estimator/input noise']])
set_param([sys,'/',['AutoRegressive ',13,'with eXternal input',13,'model estimator/input noise']],...
'Port','3',...
'position',[55,140,75,160])
add_line([sys,'/',['AutoRegressive ',13,'with eXternal input',13,'model estimator']],[80,150;110,150;110,110;125,110])
add_line([sys,'/',['AutoRegressive ',13,'with eXternal input',13,'model estimator']],[80,50;110,50;110,90;125,90])
add_line([sys,'/',['AutoRegressive ',13,'with eXternal input',13,'model estimator']],[80,100;125,100])
add_line([sys,'/',['AutoRegressive ',13,'with eXternal input',13,'model estimator']],[165,100;200,100])
set_param([sys,'/',['AutoRegressive ',13,'with eXternal input',13,'model estimator']],...
'Mask Display','ARX',...
'Mask Type','ARX')
set_param([sys,'/',['AutoRegressive ',13,'with eXternal input',13,'model estimator']],...
'Mask Dialogue','ARX model estimator.\nHook input 1 to system input.\nHook input 2 to system output.|Length of buffer:|Orders of model [na nb nk]:|Calculate after how many points:|Sample time:')
set_param([sys,'/',['AutoRegressive ',13,'with eXternal input',13,'model estimator']],...
'Mask Translate','method = ''arx''; npts=@1; order=@2; HowOften=@3; ts=@4(1); if length(@4) > 1, offset = @4(2), else, offset = 0; end')
set_param([sys,'/',['AutoRegressive ',13,'with eXternal input',13,'model estimator']],...
'Mask Help','Hook the system''s input to the first port of this block and the system''s output to second port. The input noise, which is optional, may be hooked to input 3.\nResults are displayed as the estimated output versus the true output in graphical form. Use signals with high harmonic content for best results. ')
set_param([sys,'/',['AutoRegressive ',13,'with eXternal input',13,'model estimator']],...
'Mask Entries','256\/[3 4 0]\/64\/0.05\/')
% Finished composite block ['AutoRegressive ',13,'with eXternal input',13,'model estimator'].
set_param([sys,'/',['AutoRegressive ',13,'with eXternal input',13,'model estimator']],...
'Drop Shadow',4,...
'position',[130,192,175,248])
% Subsystem ['Output-error ',13,'model estimator.'].
new_system([sys,'/',['Output-error ',13,'model estimator.']])
set_param([sys,'/',['Output-error ',13,'model estimator.']],'Location',[0,0,371,185])
add_block('built-in/Inport',[sys,'/',['Output-error ',13,'model estimator./system input']])
set_param([sys,'/',['Output-error ',13,'model estimator./system input']],...
'position',[55,40,75,60])
add_block('built-in/S-Function',[sys,'/',['Output-error ',13,'model estimator./S-function',13,'block ']])
set_param([sys,'/',['Output-error ',13,'model estimator./S-function',13,'block ']],...
'function name','sfunid',...
'parameters','order,npts,HowOften,offset,ts,method',...
'position',[205,80,260,120])
add_block('built-in/Inport',[sys,'/',['Output-error ',13,'model estimator./system output']])
set_param([sys,'/',['Output-error ',13,'model estimator./system output']],...
'Port','2',...
'position',[55,90,75,110])
add_block('built-in/Mux',[sys,'/',['Output-error ',13,'model estimator./Mux']])
set_param([sys,'/',['Output-error ',13,'model estimator./Mux']],...
'inputs','3',...
'position',[130,82,160,118])
add_block('built-in/Inport',[sys,'/',['Output-error ',13,'model estimator./input noise']])
set_param([sys,'/',['Output-error ',13,'model estimator./input noise']],...
'Port','3',...
'position',[55,140,75,160])
add_line([sys,'/',['Output-error ',13,'model estimator.']],[80,150;110,150;110,110;125,110])
add_line([sys,'/',['Output-error ',13,'model estimator.']],[80,50;110,50;110,90;125,90])
add_line([sys,'/',['Output-error ',13,'model estimator.']],[80,100;125,100])
add_line([sys,'/',['Output-error ',13,'model estimator.']],[165,100;200,100])
set_param([sys,'/',['Output-error ',13,'model estimator.']],...
'Mask Display','OE',...
'Mask Type','OE')
set_param([sys,'/',['Output-error ',13,'model estimator.']],...
'Mask Dialogue','Output-error model estimator.\nHook input 1 to system input.\nHook input 2 to system output.|Length of buffer:|Orders of model [nb nf nk]:|Calculate after how many points:|Sample time:')
set_param([sys,'/',['Output-error ',13,'model estimator.']],...
'Mask Translate','method = ''oe''; npts=@1; order=@2; HowOften=@3; ts=@4(1); if length(@4) > 1, offset = @4(2), else, offset = 0; end')
set_param([sys,'/',['Output-error ',13,'model estimator.']],...
'Mask Help','Hook the system''s input to the first port of this block and the system''s output to second port. The input noise, which is optional, may be hooked to input 3.\nResults are displayed as the estimated output versus the true output in graphical form. Use signals with high harmonic content for best results. ')
set_param([sys,'/',['Output-error ',13,'model estimator.']],...
'Mask Entries','256\/[3 3 0]\/64\/0.05\/')
% Finished composite block ['Output-error ',13,'model estimator.'].
set_param([sys,'/',['Output-error ',13,'model estimator.']],...
'Drop Shadow',4,...
'position',[130,302,175,358])
drawnow
% Return any arguments.
if (nargin | nargout)
% Must use feval here to access system in memory
if (nargin > 3)
if (flag == 0)
eval(['[ret,x0,str,ts,xts]=',sys,'(t,x,u,flag);'])
else
eval(['ret =', sys,'(t,x,u,flag);'])
end
else
[ret,x0,str,ts,xts] = feval(sys);
end
else
drawnow % Flash up the model and execute load callback
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -