How to convert table to an array when the first two variables are different?
古いコメントを表示
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 件のコメント
Image Analyst
2017 年 4 月 14 日
You forgot to attach 'm17cm17.nodc'. Come on, make it easy for us to help you, not hard.
andrea molina
2017 年 4 月 14 日
Stephen23
2017 年 4 月 14 日
@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
2017 年 4 月 15 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Tables についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
