Question about import a .txt file into matlab
Mostrar comentarios más antiguos
I'm trying to import a .txt data, but when i used the import data option, something goes wrong and does not appear the file that I want to analyse.
The file is attached. Thank you so much!
3 comentarios
Bob Thompson
el 10 de Oct. de 2019
What exactly goes wrong? What command are you using to do the import?
Johan Sebastian Diaz Tovar
el 10 de Oct. de 2019
Bob Thompson
el 11 de Oct. de 2019
I'm not sure about the exact error you're getting, but I would guess the error line is not reading because you have the row start line. In the textscan documentation the first three inputs are the file ID, the formatspec, and the number of repetitions you want to capture. The format spec you have specified for the error line returns a single cell which contains a series of strings for all individual lines of the file. For me, using the repetition number returned a blank cell with no data. I would suggest getting rid of that number (which I suspect is supposed to be the number of header lines).
Which bits of data are you trying to capture from the file? I see three integers, a comma, and two to three more integers, before a series of spaces with a 0 or -0 as the final characters. Are you looking to capture the numbers on either side of the comma? Or is that supposed to be one number, and the 0 is the second column?
Respuesta aceptada
Más respuestas (1)
prasanth s
el 10 de Oct. de 2019
0 votos
you can use 'fopen' and 'fread' functions.
Categorías
Más información sobre Entering Commands en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
