How to read input.txt?
6 views (last 30 days)
Yasuyuki Hamanaka on 24 Aug 2021
Would you tell me how to read .txt file like below.
I would like to read first two lines as string and other lines as real.
I tried to use fscanf though, it doesn't work well.
More Answers (1)
dpb on 24 Aug 2021
Are the string data pertinent or just in the way of returning the numeric data?
If the former, while you can make it work with low-level i/o such as fprintf, it's the hard way to go at it -- use
If the latter and the text is (say) a header line and units or similar, use readtable