What is the code to use for format spec in order to get matrix table where each column contain contain 4 data?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Yeap Jia Wei
am 5 Mai 2015
Beantwortet: Star Strider
am 5 Mai 2015
if true
Data = fopen('Track.txt', 'r');
formatspec = '';
Matrix = [4,inf];
DataInMatrix = fscanf(Data, formatspec, Matrix);
end
0 Kommentare
Akzeptierte Antwort
Star Strider
am 5 Mai 2015
This works:
fidi = fopen('Track.txt','r');
Data = textscan(fidi, '%s%f', 'Delimiter',':');
DataInMatrix = reshape(Data{2}, 4, []);
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Cell Arrays 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!