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_ctf_pos.m
    path of file: ./repos/fieldtrip/fileio/private
    
    the code of the file until where you have to start completion: function [fid, pnt, label] = read_ctf_pos(filename)

% READ_CTF_POS reads Polhemus file created with the CTF digitizer application
%
% Use as
%   [fid, pnt, label] = read_ctf_pos(filename)
% Input:
% filename  - Polhemus ASCII file containing digitized points
%
% Output:
% fid   - fiducial         locations of fiducials
% pnt   - sensor/headshape locations 
% label - labels of the fiducials
%
% IMPORTANT: Note that Polhemus data files should be -ASCII files with
% extension .pos generated by the CTF digitizer

% Copyright (C) 2012: Jan-Mathijs Schoffelen
% $Id$

[pth,nam,ext] = fileparts(filename);

    
function [fid, pnt, label] = read_ctf_pos(filename)

% READ_CTF_POS reads Polhemus file created with the CTF digitizer application
%
% Use as
%   [fid, pnt, label] = read_ctf_pos(filename)
% Input:
% filename  - Polhemus ASCII file containing digitized points
%
% Output:
% fid   - fiducial         locations of fiducials
% pnt   - sensor/headshape locations 
% label - labels of the fiducials
%
% IMPORTANT: Note that Polhemus data files should be -ASCII files with
% extension .pos generated by the CTF digitizer

% Copyright (C) 2012: Jan-Mathijs Schoffelen
% $Id$

[pth,nam,ext] = fileparts(filename);
if ~strcmp(ext,'.pos')
    warndlg(sprintf('Wrong input file format\n'));
    return
end