%
%  function out = mpck(da, iv);
%
%     Pack a VARYING matrix OUT from data DA and independent variable 
%     IV. Each row in DA corresponds to the same row in IV.
%
function out = mpck(da, iv);

    out = [];
    [mtd, nrd, ncd, nxd] = minfo(da);
    if ~strcmp( mtd, 'cons' )
       disp('Constant data matrix is needed.');
       return;
    end
    [mti, nri, nci, nxi] = minfo(iv);
    if ~strcmp( mti, 'cons' )
       disp('Constant independent variable matrix is needed.');
       return
    end
    
    if nri ~= nrd
       disp('Number of rows in data matrix and independend');
       disp('varialbel matrix must agree.');
       return      
    end
    
    out = vtp(vpck(da, iv));
end
