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: xfm_read.m
    path of file: ./repos/brainSurfer/scripts/fs
    
    the code of the file until where you have to start completion: function M = xfm_read(fname)
% M = xfm_read(fname)


%
% xfm_read.m
%
% Original Author: Bruce Fischl
%
% Copyright Â© 2011 The General Hospital Corporation (Boston, MA) "MGH"
%
% Terms and conditions for use, reproduction, distribution and contribution
% are found in the 'FreeSurfer Software License Agreement' contained
% in the file 'LICENSE' found in the FreeSurfer distribution, and here:
%
% https://surfer.nmr.mgh.harvard.edu/fswiki/FreeSurferSoftwareLicense
%
% Reporting: freesurfer@nmr.mgh.harvard.edu

    
function M = xfm_read(fname)
% M = xfm_read(fname)


%
% xfm_read.m
%
% Original Author: Bruce Fischl
%
% Copyright Â© 2011 The General Hospital Corporation (Boston, MA) "MGH"
%
% Terms and conditions for use, reproduction, distribution and contribution
% are found in the 'FreeSurfer Software License Agreement' contained
% in the file 'LICENSE' found in the FreeSurfer distribution, and here:
%
% https://surfer.nmr.mgh.harvard.edu/fswiki/FreeSurferSoftwareLicense
%
% Reporting: freesurfer@nmr.mgh.harvard.edu
%


fid = fopen(fname) ;
if (fid < 0)
	error(sprintf('could not open file %s', fname));
end