- What delimiter is used between the columns in the text file?
how to remain the original matrix dimension and remove blank cells
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentario
Respuestas (1)
Image Analyst
el 30 de Oct. de 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 comentarios
Ver también
Categorías
Más información sobre Data Import and Export en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!