Here's a subset of the data I'm trying to import into MATLAB:
Time = 0.50734E-01 X Y Z EP_g 23.865 25.227 -0.50000 0.56828 24.135 25.227 -0.50000 0.56839 23.865 25.500 -0.50000 0.56834 24.135 25.500 -0.50000 0.56831 Time = 1.00059E-01 X Y Z EP_g 23.865 25.227 -0.50000 0.56828 24.135 25.227 -0.50000 0.56840 23.865 25.500 -0.50000 0.56835 24.135 25.500 -0.50000 0.56832
I am trying to import this data using textscan and fgetl but have been having trouble. The problem is those pesky lines between each subset.
The column on the far right (EP_g) is the only thing I'm really interested in. By the time I'm done, I just want a matrix with the transpose of the EP_g column along the rows, i.e.,
data = 0.56828 0.56839 0.56834 0.56831 0.56828 0.56840 0.56835 0.56832
My attempt at a solution:
fid=fopen(file) while ~feof(fid) tmp=textscan(fid,'%f%f%f%f','Headerlines',5) for j=[1:2] fgetl(fid) end; end; fclose(fid);
I would appreciate any guidance or help you can give me. Many thanks!
Best Answer