Import column from files
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello,
I have 200 files with names starting from 3201.rad to 3396.rad, each files has header (5 lines of text), 1057 raw and 3 columns. I want to create a matrix with the second column of each file, without the header. Matrix with 1057 raw, 196 column.
Thank you in advance for your help!
M.
0 Kommentare
Antworten (1)
Matt J
am 12 Jul. 2013
A=zeros(1507,196);
for i=3201:3396
filename=[num2str(i) '.raw'];
A(:,i) = dlmread(filename,'',[5,1,1511,1]);
end
2 Kommentare
Matt J
am 12 Jul. 2013
Bearbeitet: Matt J
am 12 Jul. 2013
Works fine for me, Momo. What version of MATLAB are you using and are you sure you're calling DLMREAD with 3 input arguments, like in what I posted?
The error message says it's trying to read row 1, field 5. It should not be doing that if you've called it with the 3rd argument.
Siehe auch
Kategorien
Mehr zu Debugging and Analysis finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!