フィルターのクリア

Reading a Text file and columns with data

2 ビュー (過去 30 日間)
Am Gill
Am Gill 2020 年 11 月 15 日
コメント済み: Ameer Hamza 2020 年 11 月 15 日
Hi, I am trying to read a text file that is attached to this question. It looks something like this:
Number of Days
Day 1 Temperature
250 1003
300 1005
350 1008
400 1013
450 1020
500 1029
550 1040
600 1051
650 1063
700 1075
750 1087
800 1099
900 1121
1000 1142
1100 1155
1200 1173
1300 1190
1400 1204
1500 1216
I am just trying to read the numerical data. That is to say that I am trying to read this text file without the 'number of days', without the space between 'the number of days' and the column headings and neither the column headings themselves (day 1 and temperature).
I would also like to read and save the Data in 2 columns (just like it is shows): one for Days and one for Temperature.
Please help! I used the fscanf function and import data but they did not work!
Please help!

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 11 月 15 日
You can use readmatrix()
M = readmatrix('Data2.txt', 'NumHeaderLines', 3)
  2 件のコメント
Am Gill
Am Gill 2020 年 11 月 15 日
Thank you so much! It worked perfectly!
Ameer Hamza
Ameer Hamza 2020 年 11 月 15 日
I am glad to be of help!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by