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: read_vtk.m
    path of file: ./repos/bspm/thirdparty/spm12/external/fieldtrip/fileio/private
    
    the code of the file until where you have to start completion: function [pnt, tri] = read_vtk(fn)

% READ_VTK reads a triangulation from a VTK (Visualisation ToolKit) format file
% Supported are triangles.
%
% Use as
%   [pnt, tri] = read_vtk(filename)
%
% See also WRITE_VTK

% Copyright (C) 2002, Robert Oostenveld

    
function [pnt, tri] = read_vtk(fn)

% READ_VTK reads a triangulation from a VTK (Visualisation ToolKit) format file
% Supported are triangles.
%
% Use as
%   [pnt, tri] = read_vtk(filename)
%
% See also WRITE_VTK

% Copyright (C) 2002, Robert Oostenveld
%
% $Id$

fid = fopen(fn, 'rt');
if fid~=-1
  
  npnt = 0;
  while (~npnt)
    line = fgetl(fid);
    if ~isempty(findstr(line, 'POINTS'))
      npnt = sscanf(line, 'POINTS %d float');
    end