function test_file(path_to_file)
% Purpose: test the existence of a file and generate an error if it doesn't
% exist
%
% Variables: 
%	- path_to_file: string of the full path of the file to test
%
% Global variables: none

% Arguments processing
if nargin ~= 1
   error('Bad number of arguments');
end

% Testing
if (~exist(path_to_file,'file'))
   err=sprintf('File %s doesnt exist',path_to_file);
   error(err);
end

