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: spm_dicom_text_to_dict.m
    path of file: ./repos/bspm/thirdparty/spm12
    
    the code of the file until where you have to start completion: function dict = spm_dicom_text_to_dict(textfile)
% Create a DICOM dictionary .mat file from a text version
% FORMAT dict = spm_dicom_text_to_dict(textfile)
% OR            spm_dicom_text_to_dict(textfile)
% textfile    - the name of a suitable text version of the dictionary.
%               With no output argument, the results are saved in a .mat
%               file of the same base name.
%__________________________________________________________________________
% The text version is typically generated by copy/pasting from the
% "Digital Imaging and Communications in Medicine (DICOM) Part 6:
% Data Dictionary" pdf file from http://medical.nema.org/standard.html,
% and manually tidying it up (about a solid day's effort).  A
% re-formatted text version is then obtained by running the following:
%
% awk < DICOM2011_dict.txt '{if ($NF=="RET") print $1,$(NF-3),$(NF-2),$(NF-1); else print $1,$(NF-2),$(NF-1),$(NF);}' | sed 's/(/ /' | sed 's/,/ /' | sed 's/)//' | awk '{printf("%s\t%s\t%s\t%s\t%s\n", $1,$2,$3,$4,$5)}' > new_dicom_dict.txt 
%
% After this, the spm_dicom_text_to_dict function can be run to generate
% the data dictionary.

    
function dict = spm_dicom_text_to_dict(textfile)
% Create a DICOM dictionary .mat file from a text version
% FORMAT dict = spm_dicom_text_to_dict(textfile)
% OR            spm_dicom_text_to_dict(textfile)
% textfile    - the name of a suitable text version of the dictionary.
%               With no output argument, the results are saved in a .mat
%               file of the same base name.
%__________________________________________________________________________
% The text version is typically generated by copy/pasting from the
% "Digital Imaging and Communications in Medicine (DICOM) Part 6:
% Data Dictionary" pdf file from http://medical.nema.org/standard.html,
% and manually tidying it up (about a solid day's effort).  A
% re-formatted text version is then obtained by running the following:
%
% awk < DICOM2011_dict.txt '{if ($NF=="RET") print $1,$(NF-3),$(NF-2),$(NF-1); else print $1,$(NF-2),$(NF-1),$(NF);}' | sed 's/(/ /' | sed 's/,/ /' | sed 's/)//' | awk '{printf("%s\t%s\t%s\t%s\t%s\n", $1,$2,$3,$4,$5)}' > new_dicom_dict.txt 
%
% After this, the spm_dicom_text_to_dict function can be run to generate
% the data dictionary.
%__________________________________________________________________________
% Copyright (C) 2002-2014 Wellcome Trust Centre for Neuroimaging

% John Ashburner
% $Id: spm_dicom_text_to_dict.m 6416 2015-04-21 15:34:10Z guillaume $


if ~nargin, textfile = fullfile(spm('Dir'),'spm_dicom_dict.txt'); end