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 Center および File ExchangeData Import and Export についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by