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: saveoff.m
    path of file: ./repos/jigsaw-matlab/parse
    
    the code of the file until where you have to start completion: function saveoff(name,mesh)
%SAVEOFF save an *.OFF file for JIGSAW.
%
%   SAVEOFF(NAME,MESH);

    
function saveoff(name,mesh)
%SAVEOFF save an *.OFF file for JIGSAW.
%
%   SAVEOFF(NAME,MESH);
%
%   The following entities are optionally saved to the file
%   "NAME.OFF":
%
%   MESH.POINT.COORD - [NPxND+1] array of point coordinates,
%       where ND is the number of spatial dimenions.
%
%   MESH.TRIA3.INDEX - [N3x 4] array of indexing for TRIA-3
%       elements, where INDEX(K,1:3) is an array of "points"
%       associated with the K-TH tria, and INDEX(K,4) is an
%       associated ID tag.
%
%   MESH.QUAD4.INDEX - [N3x 5] array of indexing for QUAD-4
%       elements, where INDEX(K,1:4) is an array of "points"
%       associated with the K-TH quad, and INDEX(K,5) is an
%       associated ID tag.
%
%   See also SAVEMSH, LOADMSH
%

%-----------------------------------------------------------
%   Darren Engwirda
%   github.com/dengwirda/jigsaw-matlab
%   21-Sep-2020
%   d.engwirda@gmail.com
%-----------------------------------------------------------
%

   [ok] = certify(mesh);

    if (~ischar  (name))
        error('NAME must be a valid file-name!') ;
    end