What is the code to use for format spec in order to get matrix table where each column contain contain 4 data?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Yeap Jia Wei
le 5 Mai 2015
Réponse apportée : Star Strider
le 5 Mai 2015
if true
Data = fopen('Track.txt', 'r');
formatspec = '';
Matrix = [4,inf];
DataInMatrix = fscanf(Data, formatspec, Matrix);
end
0 commentaires
Réponse acceptée
Star Strider
le 5 Mai 2015
This works:
fidi = fopen('Track.txt','r');
Data = textscan(fidi, '%s%f', 'Delimiter',':');
DataInMatrix = reshape(Data{2}, 4, []);
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Cell Arrays dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!