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: writeOBJ.m
    path of file: ./repos/gptoolbox/mesh
    
    the code of the file until where you have to start completion: function writeOBJ(filename, V,F,UV,TF,N,NF,comment)

    
function writeOBJ(filename, V,F,UV,TF,N,NF,comment)
  % WRITEOBJ writes an OBJ file with vertex/face information
  %
  % writeOBJ(filename, V,F,UV,TF,N,NF,comment)
  %
  % Input:
  %  filename  path to .obj file
  %  V  #V by 3 list of vertices
  %  F  #F by 3 list of triangle indices
  %  UV  #UV by 2 list of texture coordinates
  %  TF  #TF by 3 list of corner texture indices into UV
  %  N  #N by 3 list of normals
  %  NF  #NF by 3 list of corner normal indices into N
  %

%disp(['writing: ',filename]);
f = fopen( filename, 'w' );

if exist('comment','var') && ~isempty(comment)
  fprintf(f,'# %s\n',comment);
end