Borrar filtros
Borrar filtros

How to read file using textscan

2 visualizaciones (últimos 30 días)
Aoyi
Aoyi el 5 de Mayo de 2018
Respondida: Alfonso el 5 de Mayo de 2018
I have a file with 4 row:
SiteNo time mintemperature maxtemperature
The time have already change into matlab format time. How can I read the file using textscan?

Respuesta aceptada

Alfonso
Alfonso el 5 de Mayo de 2018
You could try:
filename = 'myFile.txt'; % example
fileID = fopen(filename);
C = textscan(fileID,'%d %s %.2f %.2f'); % SiteNo(integer), time(string), maxtemp and mintemp(float with 2 decimal),
fclose(fileID);

Más respuestas (0)

Categorías

Más información sobre Large Files and Big Data en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by