Path = 'Type in the correct path'
filename = 'Input the correct filename'
fileloc =[Path '/' filename];
fileID = fopen(fileloc); %openFile for reading
readstartrow = 16; %skip the first 16 rows
natoms = 134; % number of atoms in POPC file
format = '%10d%15s%8d%8s%8s%8d%8.2f%8.3f%10s%4.4f%*[^\n]';
AllColumns = textscan(fileID, format, natoms, 'Delimiter', '',...
WhiteSpace', '', 'EmptyValue' ,NaN,'HeaderLines', readstartrow, 'ReturnOnError', false); %Reads all columns of POPC.itp file
fclose(fileID);
charge = AllColumns{7}; %Returns all charges