reading a txt with periodic strings

1 回表示 (過去 30 日間)
Anna Prati
Anna Prati 2019 年 10 月 30 日
回答済み: Shivam Prasad 2019 年 11 月 4 日
Good afternoon,
I am trying to read a txt file that has
  • 11 lines of header
  • 8000 values
  • 2 lines of string
  • 8000 values
  • 2 lines of string
  • 2 lines of string
  • 8000 values
  • ....
I know how I can skip the header but not how to skip those 2 string lines every 8000 values.
Thank you a lot
Anna

回答 (1 件)

Shivam Prasad
Shivam Prasad 2019 年 11 月 4 日
Hi Anna,
I understand that the 8000 values contains the values as numeric types.
You can read all the values as strings from the text file, and ignore those values which are non-numeric. This can be checked by using the str2double function.

カテゴリ

Help Center および File ExchangeMATLAB Report Generator についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by