read text file into matlab
53 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Pradeep Sanjeewa
le 27 Jan 2015
Commenté : Pradeep Sanjeewa
le 27 Jan 2015
https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data
How can we read that kind of data set into matlab? I want just the numerical values. May be to a 4x200 matrix
0 commentaires
Réponse acceptée
Hikaru
le 27 Jan 2015
Use textscan.
FID = fopen('iris.txt')
C_data0 = textscan(FID,'%f %f %f %f %s', 200, 'Delimiter',',')
numericVector = cell2mat(C_data0(:,1:4)) %ignores the last column of strings
2 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Data Import and Export 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!