Error while using function readtable()
5 次查看(过去 30 天)
显示 更早的评论
I use function readtable to read a txt file, it works well before, but suddenly it don't works anymore and return the error:
>> a2=readtable('dyw_e_u.txt');
Error using readtable
inputs must be a string array, character vector, or cell array of character vectors.
>> a2=readtable("dyw_e_u.txt");
Error using readtable
inputs must be a string array, character vector, or cell array of character vectors.
I think what I input 'dyw_e_u.txt' is a character vector, I don't understand why it return the error, please help, thanks
My text file is like this:
Lat Lon mm.dd.yyyy hh:mm:ss U(m^2/s) V(m^2/s) u(cm/s) v(cm/s) Depth(m)
22.4189 114.9908 2021/5/31 0:00:00 -1.123 1.949 -4.16 7.22 26.993
22.4189 114.9908 2021/5/31 1:00:00 -0.452 1.484 -1.675 5.497 26.993
22.4189 114.9908 2021/5/31 2:00:00 0.361 1.06 1.338 3.926 26.993
22.4189 114.9908 2021/5/31 3:00:00 0.994 0.838 3.684 3.104 26.993
22.4189 114.9908 2021/5/31 4:00:00 1.353 0.544 5.014 2.017 26.993
22.4189 114.9908 2021/5/31 5:00:00 1.597 -0.203 5.917 -0.754 26.993
22.4189 114.9908 2021/5/31 6:00:00 1.916 -1.429 7.097 -5.293 26.993
22.4189 114.9908 2021/5/31 7:00:00 2.289 -2.645 8.482 -9.798 26.993
22.4189 114.9908 2021/5/31 8:00:00 2.466 -3.196 9.137 -11.84 26.993
9 个评论
Walter Roberson
2023-10-12
I suggest you use
dbstop if error
and run your code, and then when it stops at the error line, start working backwards to trace the cause.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!