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!
