MATLAB: Import txt file containing some comment character = “#”

import txtMATLAB

Hi all, I want to import an txtfile containing in the middle of the file some lines with a comment character "#". Thank you in advance,

Best Answer

Mention:
....'CommentStyle','#')
fileID = fopen(filename); %an example
C = textscan(fileID,formatspec','Delimiter',',','CommentStyle','#');
fclose(fileID);