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 CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by