2005-02-18 20:54:39 +01:00
|
|
|
function [a,b] = ffill(x,ixc,y)
|
|
|
|
|
2008-01-28 15:28:06 +01:00
|
|
|
% function [a,b] = ffill(x,ixc,y)
|
|
|
|
% Makes the horizontale concatenation if x exists
|
|
|
|
% and fills the matrix with 0 if x and y are not the same size.
|
|
|
|
%
|
|
|
|
% INPUTS
|
|
|
|
% x: matrix
|
|
|
|
% ixc: vector of indices
|
|
|
|
% y: matrix
|
|
|
|
%
|
|
|
|
% OUTPUTS
|
|
|
|
% a: concatenation results
|
|
|
|
% b: vector
|
|
|
|
%
|
|
|
|
% SPECIAL REQUIREMENTS
|
|
|
|
% none
|
|
|
|
%
|
|
|
|
% part of DYNARE, copyright Dynare Team (2001-2008)
|
|
|
|
% Gnu Public License.
|
|
|
|
|
|
|
|
|
2005-02-18 20:54:39 +01:00
|
|
|
xc = size(x,1) ;
|
|
|
|
|
|
|
|
if isempty(y)
|
|
|
|
b = [ixc; 0];
|
|
|
|
a = [x zeros(size(x,1),1)];
|
|
|
|
else
|
|
|
|
yc = size(y,1) ;
|
|
|
|
b = [ixc;yc] ;
|
|
|
|
|
|
|
|
if xc > yc
|
|
|
|
a = [x [y;zeros(xc-yc,size(y,2))]] ;
|
|
|
|
elseif yc > xc
|
|
|
|
a = [[x;zeros(yc-xc,size(x,2))] y] ;
|
|
|
|
else
|
|
|
|
a = [x y] ;
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
% 2001/09/1 MJ corrected for absent lags
|