I have been trying to import a .itp file from molecular dynamics simulation but the format specifications seems not work.
Below is the sample code I a have been trying to utilize.
close all; clear all; clc;filename = 'Input correct filename';path = 'Input correct Path';a = [path '/' filename];readstartrow = 16; % start reading after row 16
fileID = fopen(a);format = '%d%5s%5d%5s%5s%5d%8.2f%8.4f%8s%8.4f%*[^ ;]'; % Format specs for the
All = textscan(fileID,format, 100,'Delimiter','','WhiteSpace', '', 'EmptyValue' ,NaN,'HeaderLines', readstartrow,'ReturnOnError', false);fclose(fileID)
I have attached a screenshot of how the file appears
Best Answer