What is the code to use for format spec in order to get matrix table where each column contain contain 4 data?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Yeap Jia Wei
il 5 Mag 2015
Risposto: Star Strider
il 5 Mag 2015
if true
Data = fopen('Track.txt', 'r');
formatspec = '';
Matrix = [4,inf];
DataInMatrix = fscanf(Data, formatspec, Matrix);
end
0 Commenti
Risposta accettata
Star Strider
il 5 Mag 2015
This works:
fidi = fopen('Track.txt','r');
Data = textscan(fidi, '%s%f', 'Delimiter',':');
DataInMatrix = reshape(Data{2}, 4, []);
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Cell Arrays in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!