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: writeOFF.m
    path of file: ./repos/gptoolbox/mesh
    
    the code of the file until where you have to start completion: function writeOFF(filename, V,F,UV,C,N)
  % WRITEOFF writes an OFF file with vertex/face information
  %
  % writeOFF(filename,V,F)
  % writeOFF(filename,V,F,UV,C,N)
  %
  % Input:
  %  filename  path to .obj file
  %  V  #V by 3 list of vertices
  %  F  #F by 3 list of triangle indices
  %  UV  #V by 2 list of texture coordinates
  %  C  #V by 3 list of colors
  %  N  #V by 3 list of normals

%disp(['writing: ',filename]);

hasN =  exist('N','var') && ~isempty(N);
hasUV = exist('UV','var') && ~isempty(UV);
hasC = exist('C','var') && ~isempty(C);

    
function writeOFF(filename, V,F,UV,C,N)
  % WRITEOFF writes an OFF file with vertex/face information
  %
  % writeOFF(filename,V,F)
  % writeOFF(filename,V,F,UV,C,N)
  %
  % Input:
  %  filename  path to .obj file
  %  V  #V by 3 list of vertices
  %  F  #F by 3 list of triangle indices
  %  UV  #V by 2 list of texture coordinates
  %  C  #V by 3 list of colors
  %  N  #V by 3 list of normals

%disp(['writing: ',filename]);

hasN =  exist('N','var') && ~isempty(N);
hasUV = exist('UV','var') && ~isempty(UV);
hasC = exist('C','var') && ~isempty(C);

OFFheader = 'OFF';

OFFV = V;

if hasN
    OFFheader = ['N',OFFheader];
    OFFV = [OFFV N];
end