Loading CSV file (date column A, identifier row, rest data)
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Oli
am 15 Mär. 2016
Bearbeitet: Walter Roberson
am 9 Mai 2025
I want to Import the attached csv with following Code:
>> d = dbload('data_US.csv');
If I then check for the variable d, it shows correctly 13 fields, but each of the fields contains only NaN's
Thank you very much
4 Kommentare
Akzeptierte Antwort
Daniel LaCroix
am 16 Mär. 2016
There is a function called csvread that should load the file.
If your file has headers (or anything other than numbers), the command won't work. To get around this, set it to have an offset of one row (and no column offset).
data=csvread('data_US.csv') or data=csvread('data_US.csv',1,0)
You can also select a more specific range of data if you need to, so check out the documentation if that's something you want to do.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Workspace Variables and MAT Files finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!