You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: cat_vol_ctype.m
    path of file: ./repos/cat12
    
    the code of the file until where you have to start completion: function Y = cat_vol_ctype(Y,type)
% ______________________________________________________________________

    
function Y = cat_vol_ctype(Y,type)
% ______________________________________________________________________
% Y = cat_vol_ctype(Y[,type])
%
% Convert datatype with checking of min/max, nan, and rounding for 
% [u]int[8|16], single, double, and char. Default round type is 'uint8'. 
% Y has to be a matrix or cell. 
%
% This function is only written for our private use, mostly to convert 
% single to uint8. We did not check for special behavior, for extremly 
% high values or special rounding issues, or converting to larger 
% classes etc.!
% ______________________________________________________________________
%
% Christian Gaser, Robert Dahnke
% Structural Brain Mapping Group (https://neuro-jena.github.io)
% Departments of Neurology and Psychiatry
% Jena University Hospital
% ______________________________________________________________________
% $Id$
% ______________________________________________________________________
 
  if nargin==0, help cat_vol_ctype; return; end