- What delimiter is used between the columns in the text file?
how to remain the original matrix dimension and remove blank cells
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commento
Risposte (1)
Image Analyst
il 30 Ott 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 Commenti
Vedere anche
Categorie
Scopri di più su Data Import and Export 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!