- What delimiter is used between the columns in the text file?
how to remain the original matrix dimension and remove blank cells
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Dear All, I imported data from a text file, this text file has 300000 rows and must have 105 columns for example. when i import it as vector matrices, all the vectors must have a length of 300000 as the original matrix A (which is the file). but it does not do that, I found out the reason is maybe because many rows has blank cells, how can i please tell MATLAB to remove the blank cells and put zeros instead so I keep the original dimension? thank you in advance
1 Kommentar
Antworten (1)
Image Analyst
am 30 Okt. 2017
If you've got blank rows at strange places, then you may just have to read in the file line-by-line with fgetl() and check for bad or blank rows. Then, if the row is good, get the numbers out, else skip it. See help for fgetl(,) and sscanf() or textscan().
2 Kommentare
Siehe auch
Kategorien
Mehr zu Data Import and Export 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!