Using code to import data
显示 更早的评论
I have text files that I am trying to import into MATLAB (sample attached). The text files contain data collected using sensors (named q01, q02 etc.). The first 5 lines are garbage all I really need are the lines of data after q01 and q02 (complete file has more sensors). I have 529 of these files that I am trying to read in so it is not practical to use the import tool each time. I have the file names stored in a structure (field=names). This is the code that I have tried to use to read in the data but it is not extracting all of the data.
delimeterIn=' ';
headerlinesIn=5;
%Imports data and creates a structure with separate fields for numerical
%and text data
for i=1:length(files)
x(i)=importdata(files(i).name, delimeterIn, headerlinesIn);
end
Any help efficiently reading these files in would be appreciated.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 App Building 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!