Error while using function readtable()

5 ビュー (過去 30 日間)
Zhenyu Huang
Zhenyu Huang 2023 年 10 月 11 日
編集済み: Zhenyu Huang 2023 年 10 月 12 日
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
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.
Ayush Gupta
Ayush Gupta 2023 年 10 月 12 日
I am also not facing any issue in R2022b as well as R2023a.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by