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: surf_to_tetgen.m
    path of file: ./repos/malini/Codes/deconvolution - model/spm8/external/fieldtrip/fileio/private
    
    the code of the file until where you have to start completion: function surf_to_tetgen(filename, nodes, elements, element_types, attributes_nodes,attributes_elements)
% This function converts a triangulated mesh in FieldTrip format into a
% surface structure readable by Tetgen software

% Copyright Arno Jannsen, 2011

%Write the node file

    
function surf_to_tetgen(filename, nodes, elements, element_types, attributes_nodes,attributes_elements)
% This function converts a triangulated mesh in FieldTrip format into a
% surface structure readable by Tetgen software

% Copyright Arno Jannsen, 2011

%Write the node file
node_filename = [filename '.node'];
precision_str = '%u   %.40e  %.40e  %.40e';

N_nodes = size(nodes,1);
if(nargin > 4)
    N_attributes = size(attributes_nodes,2);
    A = [nodes attributes_nodes];
    for i=1:N_attributes
        precision_str = [precision_str '  %.5e'];
    end