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: out_tess_dfs.m
    path of file: ./repos/brainstorm3/toolbox/io
    
    the code of the file until where you have to start completion: function out_tess_dfs( TessMat, OutputFile )
% OUT_TESS_DFS: Exports a surface to a BrainSuite .dfs file.
% 
% USAGE:  out_tess_dfs( TessMat, OutputFile )
%
% INPUT: 
%    - TessMat    : Brainstorm tesselation matrix
%    - OutputFile : full path to output file (with '.dfs' extension)

% FILE FORMAT:
%	char  hdrversion[12];   // "DFS_LE v1.0\0" on little-endian machines or "DFS_BE v1.0\0" on big-endian machines
%	int32 hdrsize;          // Size of complete header (i.e., offset of first data element)
%	int32 mdoffset;         // Start of metadata.
%	int32 pdoffset;         // Start of patient data header.
%	int32 nTriangles;		// Number of triangles
%	int32	nVertices;		// Number of vertices
%	int32 nStrips;			// Number of triangle strips
%	int32 stripSize;		// size of strip data
%	int32 normals;			// 4	Int32	<normals>	Start of vertex normal data (0 if not in file)
%	int32 uvStart;			// Start of surface parameterization data (0 if not in file)
%	int32 vcoffset;			// vertex color
%	uint8 precision;		// Vertex Precision -- usually float32 or float64

    
function out_tess_dfs( TessMat, OutputFile )
% OUT_TESS_DFS: Exports a surface to a BrainSuite .dfs file.
% 
% USAGE:  out_tess_dfs( TessMat, OutputFile )
%
% INPUT: 
%    - TessMat    : Brainstorm tesselation matrix
%    - OutputFile : full path to output file (with '.dfs' extension)

% FILE FORMAT:
%	char  hdrversion[12];   // "DFS_LE v1.0\0" on little-endian machines or "DFS_BE v1.0\0" on big-endian machines
%	int32 hdrsize;          // Size of complete header (i.e., offset of first data element)
%	int32 mdoffset;         // Start of metadata.
%	int32 pdoffset;         // Start of patient data header.
%	int32 nTriangles;		// Number of triangles
%	int32	nVertices;		// Number of vertices
%	int32 nStrips;			// Number of triangle strips
%	int32 stripSize;		// size of strip data
%	int32 normals;			// 4	Int32	<normals>	Start of vertex normal data (0 if not in file)
%	int32 uvStart;			// Start of surface parameterization data (0 if not in file)
%	int32 vcoffset;			// vertex color
%	uint8 precision;		// Vertex Precision -- usually float32 or float64
%	uint8	pad[3];				// padding
%	float64 orientation[4][4]; //4x4 matrix, affine transformation to world coordinates

% @=============================================================================
% This function is part of the Brainstorm software:
% https://neuroimage.usc.edu/brainstorm
% 
% Copyright (c) University of Southern California & McGill University
% This software is distributed under the terms of the GNU General Public License
% as published by the Free Software Foundation. Further details on the GPLv3
% license can be found at http://www.gnu.org/copyleft/gpl.html.
% 
% FOR RESEARCH PURPOSES ONLY. THE SOFTWARE IS PROVIDED "AS IS," AND THE
% UNIVERSITY OF SOUTHERN CALIFORNIA AND ITS COLLABORATORS DO NOT MAKE ANY
% WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF
% MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, NOR DO THEY ASSUME ANY
% LIABILITY OR RESPONSIBILITY FOR THE USE OF THIS SOFTWARE.
%
% For more information type "brainstorm license" at command prompt.
% =============================================================================@
%
% Authors: David Shattuck (shattuck@loni.ucla.edu)
%          Francois Tadel, 2009-2016

% ===== CONVERT TO BRAINSUITE FORMAT =====
TessMat.Vertices = TessMat.Vertices' * 1000;
TessMat.Faces    = TessMat.Faces' - 1; 


% ===== SAVE FILE =====
% Open file for binary writing
[fid, message] = fopen(OutputFile, 'wb', 'ieee-le');
if (fid < 0)
    error(['Could not create file : ' message]);
end