⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 exresp.m

📁 数字通信第四版原书的例程
💻 M
字号:
function exresp(fun,ssflag) 
%EXRESP Example response, used by plotting control routines to give
%       an example or their use.
%	EXRESP('fun')
%	EXRESP('fun',ssflag)

%	Andrew Grace  7-9-90
%	Revised ACWG 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:')
if fun(1)=='d'
  disp(' of the form G(z)=num(z)/den(z):')
  [num,den]=drmodel(order)
else
  disp(' of the form G(s)=num(s)/den(s):')
  [num,den]=rmodel(order)
end
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);'];
else
  call=[fun,'(num,den);'];
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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -