Import Several txt files [Error: Getting only first line of first file]
1 次查看(过去 30 天)
显示 更早的评论
Hi, I am trying to open several txt files into Matlab, as multiples 2d arrays.
These files have float contents and integers all mixed. The files also, might not have the same sizes.
I have searched some online answers and I was using several ideas, however, I got as further as to read the first line of the first file. But that is not the result I wanted.
As example of the files I am using I have the attachements.
The following is the code I am using.
Folder = pwd;
Files = dir(fullfile(Folder, '*.txt'));
Result = cell(1, numel(Files));
for j = 1:numel(Files)
aFile = fullfile(Folder, Files(j).name);
Data = csvread(aFile);
end
0 个评论
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Low-Level File I/O 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!