% function out = vceil(mat)
%
%   Calculate ceil of VARYING/CONSTANT matrix, identical
%   to MATLAB's CEIL command, but VCEIL works on
%   VARYING matrices also.
%
%   See also: CEIL, VABS, VEBE, VEVAL, VIMAG and VFLOOR.

function out = vceil(mat)
 if nargin ~= 1
   disp('usage: out = vceil(mat)')
   return
 end
 [mtype,mrows,mcols,mnum] = minfo(mat);
 if mtype == 'vary'
   [nr,nc] = size(mat);
   out = [ceil(mat(1:nr-1,1:nc-1))  mat(1:nr-1,nc);...
           mat(nr,1:nc)];
 elseif mtype == 'syst'
   error('VCEIL is undefined for SYSTEM matrices')
   return
 else
   out = ceil(mat);
 end
%
% Wes Wang at The MathWorks, add the missing function 6/16/92
