How to convert table to an array when the first two variables are different?
Ältere Kommentare anzeigen
Hello I have been working with this data set for a while and cannot get matlab to read it. The data consists of 8 variables and the first 2 are different. I will post my code and the error as well as what the data looks like.
date time pressure seatemp airtemp buoyhead windspd winddir
07/24/1994 12:00:00 1018.05 28.55 30.05 39.38 3.40 38.31
07/24/1994 13:00:00 1018.20 28.85 30.50 25.31 2.80 39.71
07/24/1994 14:00:00 1018.05 29.15 29.75 12.66 4.80 24.24
My code:
T=readtable('m17cm17.nodc','FileType','text','HeaderLines',57);
%%convert to an array
A = table2array(T)
Error: Cannot concatenate the table variables 'Var1' and 'Var2', because their types are datetime and cell.
4 Kommentare
Image Analyst
am 14 Apr. 2017
You forgot to attach 'm17cm17.nodc'. Come on, make it easy for us to help you, not hard.
andrea molina
am 14 Apr. 2017
Stephen23
am 14 Apr. 2017
@andrea molina: that just looks like a text file. Upload it after checking the file extension to .txt. Then we can help you.
andrea molina
am 15 Apr. 2017
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Tables finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
