Recognizing and removing unwanted lines from data file
이전 댓글 표시
Hey all,
After way to many hours of trial and error, and looking on the web for an answer I've ran out of options. I'm pretty sure you guys should be able to solve this problem for me since it doesn't seem that complicated.
I have a couple thousands of data files with a format like this:

I want Matlab to give me the values in the matrices, (so in the first matrix [0.75 55.0; 1.00 55.0; 1.25 86.3].
I've succeeded in writing code that will give me the first matrix, but i havent been able to textscan in such a way that it skips the unwanted lines.
d=[];ssc=[];
files = dir([datdir 'MV2*']);
for j=1:length(files)
fid = fopen([datdir files(j).name],'rt');
C=textscan(fid,'%f %f','Delimiter','\n');
fclose(fid);
d=[d;C{1}];
ssc=[ssc;C{2}];
end
Some advice or a solution would be amazing! Thanks in advance :)
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Data Import and Export에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!