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

📄 pm2tf.m

📁 控制系统计算机辅助设计——MATLAB语言与应用(源代码)
💻 M
字号:
function [num,comden]=pm2tf(comden,s0,s1,s2,s3,s4,s5,s6,s7,s8,s9,s10);
%PM2TF  Polynomial matrices to transfer function matrix
%       PM2TF(Comden,S0,S1,.Si..,S10) returns a single MIMO transfer
%       function numerator matrix, NUM, of polynomial coefficients.
%       The input arguments, Si, are a set of matrices of
%       coefficients of powers of s, starting with s^0
%       and including ALL matrices up the highest power of s.
%       Comden is a common denominator for the matrices of coefficients.
%
%       [NUM,Comden]=PM2TF(Comden,S0,S1,.Si..,S10) also returns the MIMO
%       transfer function common denominator, Comden, padded with leading
%       zeros to give it the correct length.

%       J-M. Boyle 2nd September 1987
% Copyright (c) 1987 by GEC Engineering Research Centre & Cambridge Control Ltd

nargs = nargin;             % Perform error checking on the number of
error(nargchk(2,12,nargs)); % input arguments.
args = nargs-1;
[mc,nc]=size(comden);
if (mc~=1) & (nc~=1)
   error('Common denoninator not a vector')
end
if max(mc,nc) > args
 error('Order of common denominator is higher than the numerator polynomial.')
end
if mc~=1
   comden=comden';
end
[m,n] = size(s0);           % Set-up the numerator matrix of polynomial
num = zeros(m,n*args);      %  coefficients.
index = 1:args:m*args;      %  Index specifies which columns of S, are
			    %  to be put into the numerator NUM.

			    % Form the numerator matrices input to the
for k = 0:args-1            % function into a single matrix.
  str = ['sk=s',int2str(k),';'];
  eval(str);
  [mk,nk]=size(sk);
  if (mk~=m) | (nk~=n)
     error('All coefficient matrices must be the same size.');
  end
  num(:,index+args-1-k) = sk;
end

% Pad out the denominator with leading zeros.
comden = [zeros(1,args-length(comden)), comden];
if mc~=1               % return comden in same shape
   comden = comden';
end

⌨️ 快捷键说明

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