How can I read data from certain range in txt file in matlab?
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hung Jr Chen
el 18 de Ag. de 2016
Comentada: Hung Jr Chen
el 18 de Ag. de 2016
Hi,
I would like to read from line 85 to line 1108 in txt file in matlab.
I don't know how to do it.
The data from line 85 to line 1108 looks like this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/155828/image.png)
I have 1024 data.
Can please anybody help me?
Thanks,
Hung Jr
0 comentarios
Respuesta aceptada
Walter Roberson
el 18 de Ag. de 2016
Use textscan() with HeaderLines set to 84, a format of '%f%f%f', and specify a count of (1108-85+1)
3 comentarios
Walter Roberson
el 18 de Ag. de 2016
fid = fopen('YourFile.txt', 'rt');
datacell = textscan(fid, '%f%f%f', (1108-85+1), 'HeaderLines', 84, 'CollectOutput', 1);
fclose(fid);
YourInput = datacell{1};
Más respuestas (0)
Ver también
Categorías
Más información sobre Large Files and Big Data 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!