www.gusucode.com > mbcmodels 工具箱 matlab 源码程序 > mbcmodels/@xreglinear/z21matrix.m

    function z=z21matrix(m)
%Z21MATRIX   Z2.1 matrix
%   z=z21matrix(m,Xc)  computes z21 matrix.  
%   Requires QR data to be initialised

%  Copyright 2000-2007 The MathWorks, Inc. and Ford Global Technologies, Inc.



if ~isfield(m.Store,'Q')
   error(message('mbc:xreglinear:InvalidState'));
end

if  m.Store.DispOrder
    T = terms2(m);
else
    T = Terms(m);
end

z2=m.Store.X(:,~T);
% pad z2

z = z2-  m.Store.Q*(m.Store.Q'*z2);