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/ExploreASL/External/SPMmodified/toolbox/cat12
    
    the code of the file until where you have to start completion: function Y=cat_vol_ctype(Y,type)
% ______________________________________________________________________
% Y=cat_vol_conv(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 writen for our private use, mostly to convert 
% single to uint8. I did not check for special behavior, for extremly 
% high values or special rounding issues, or converting to larger 
% classes etc.!
% ______________________________________________________________________
%
% Robert Dahnke 
% Structural Brain Mapping Group
% University Jena
%
% $Id: cat_vol_ctype.m 1442 2019-03-21 07:48:36Z dahnke $
% ______________________________________________________________________
  
   types = {'int8','int16','int32','int64','single','float32','float64'...
           'uint8','uint16','uint32','uint64','double'};

  if ~exist('type','var');
    type = 'uint8';
  else
    type  = lower(type);
    % check for additional information such as -le and cut name 

    
function Y=cat_vol_ctype(Y,type)
% ______________________________________________________________________
% Y=cat_vol_conv(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 writen for our private use, mostly to convert 
% single to uint8. I did not check for special behavior, for extremly 
% high values or special rounding issues, or converting to larger 
% classes etc.!
% ______________________________________________________________________
%
% Robert Dahnke 
% Structural Brain Mapping Group
% University Jena
%
% $Id: cat_vol_ctype.m 1442 2019-03-21 07:48:36Z dahnke $
% ______________________________________________________________________
  
   types = {'int8','int16','int32','int64','single','float32','float64'...
           'uint8','uint16','uint32','uint64','double'};

  if ~exist('type','var');
    type = 'uint8';
  else
    type  = lower(type);
    % check for additional information such as -le and cut name 
    ind = strfind(type,'-');
    if ~isempty(ind)
      type = type(1:ind-1);
    end