Importing text file containing numbers and words
2 次查看(过去 30 天)
显示 更早的评论
I want to import a text file into MATLAB. I want MATLAB to ignore the first 3 lines, detect the 4th line as header, and identify data from the 6th row on. How can it be done?
filename
date
var1 var2 var3
abc1 100 abc1
abc2 200 abc2
2 个评论
Stephen23
2022-12-28
"How can it be done?"
Of course: simply specify the appropriate options with READTABLE().
If you have any further questions, make sure that you upload a sample data file by clicking the paperclip button.
采纳的回答
Jan Studnicka
2022-12-28
data = readtable('soubor.txt','NumHeaderLines',3,'ReadVariableNames',true)
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Text Data Preparation 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!