Importing text file containing numbers and words
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Kamia Kavi
am 28 Dez. 2022
Beantwortet: Jan Studnicka
am 28 Dez. 2022
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 Kommentare
Stephen23
am 28 Dez. 2022
"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.
Akzeptierte Antwort
Jan Studnicka
am 28 Dez. 2022
data = readtable('soubor.txt','NumHeaderLines',3,'ReadVariableNames',true)
0 Kommentare
Weitere Antworten (0)
Siehe auch
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!