How to read file using textscan

조회 수: 2 (최근 30일)
Aoyi
Aoyi 2018년 5월 5일
답변: Alfonso 2018년 5월 5일
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?

채택된 답변

Alfonso
Alfonso 2018년 5월 5일
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);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Large Files and Big Data에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by