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: readBDL.m
    path of file: ./repos/gptoolbox/mesh
    
    the code of the file until where you have to start completion: function bundle  =  readBDL(filename)
% READBDL Read mesh(es) from a .bdl bundle file
%
% bundle  =  readBDL(filename)
% 
% Input:
%   filename  path to .bdl file
% Outputs:

    
function bundle  =  readBDL(filename)
% READBDL Read mesh(es) from a .bdl bundle file
%
% bundle  =  readBDL(filename)
% 
% Input:
%   filename  path to .bdl file
% Outputs:
%   bundle  struct containing mesh data

  function mesh = readBDLMeshChunk(fp)
  % read a mesh chunk from a file stream 
  %
  % Usage:
  %    mesh = readMeshChunk( fp)
  %
  % mesh fields: 
  % V  (required)  vertices
  % F              faces
  % col            colors
  % baseColor      a single color for the whole mesh
  % UV             uv coords
          
      magicID   = fread(fp, 1, 'uint32');
          chunkSize = fread(fp, 1,  'int64');  
          nV        = fread(fp, 1, 'uint32'); 
          nF        = fread(fp, 1, 'uint32');
          nVperFace = fread(fp, 1, 'uint32'); 
          nCperPos  = fread(fp, 1, 'uint32'); 
          nCperUV   = fread(fp, 1, 'uint32'); 
          nCperCol  = fread(fp, 1, 'uint32'); 
          nCperNor  = fread(fp, 1, 'uint32'); 
          strip     = fread(fp, 1, 'uchar');
          mesh.baseColor = fread(fp, 4, 'float32');
      
          mesh.V   = fread(fp, [nCperPos,nV],'float32');
      mesh.V = mesh.V';
          mesh.UV  = fread(fp, [nCperUV,nV], 'float32');
      mesh.UV = mesh.V';
          mesh.col = fread(fp, [nCperCol,nV],'float32');
      mesh.col = mesh.col';
          if nCperNor ~= 0 && nCperNor ~= 3 
            error('nCperNor has to be 0 or 3')
          end