dexresp.m

来自「本书是电子通信类的本科、研究生辅助教材」· M 代码 · 共 33 行

M
33
字号
function dexresp(fun,ssflag) 
%DEXRESP Example response for discrete functions.
%
%	DEXRESP('fun')

%	Andrew Grace 7-9-90 
%	Revised 6-21-92
%	Copyright (c) 1986-93 by the MathWorks, Inc.

if nargin==1, ssflag=0; end;

order=round(abs(randn(1,1))*5+2);
disp('')
disp([' Here is an example of how the function ', fun, ' works:'])
disp('')
disp(' Consider a randomly generated stable Transfer Function Model')
disp(' of the form G(z)=num(z)/den(z):')
[num,den]=drmodel(order)
Ts = exp(randn(1,1)-2)
if ssflag, 
  disp('Transform to state space with: [a,b,c,d] = tf2ss(num,den);');
  [a,b,c,d] = tf2ss(num,den);
  call=[fun,'(a,b,c,d,Ts);'];
else
  call=[fun,'(num,den,Ts);'];
end
disp('')
disp(['Call ', fun, ' using the following command (see also, help ',fun,'):'])
disp('')
disp(call)
disp('')
eval(call)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?