code
I found a sample of creating table from others blog, it works in his matlab.
But when i copied the code to my matlab, i got error (Subscripting into a table using three or more subscripts (as in t(i,j,k)) is not supported. Always specify a row subscript and a variable subscript, as in t(rows,vars).)

 채택된 답변

Stephen23
Stephen23 2023년 4월 6일
편집: Stephen23 2023년 4월 6일

0 개 추천

CAUSE: the bug is caused on this line, where you create a variable named TABLE:
table = table(..)
After you do that, then TABLE is a variable, and the next time you run the code MATLAB interprets () as indexing into that variable. Thus the error.
SOLUTION: Do NOT name your variable TABLE. Change the name to something else (not the name of a MATLAB function), e.g. "mytable", and CLEAR the TABLE variable from the workspace.

댓글 수: 4

J.FENG
J.FENG 2023년 4월 6일
thanks for replying
I try to change the varible name of table, but it still got the same error.
Stephen23
Stephen23 2023년 4월 6일
Did you CLEAR the workspace, as I wrote?
J.FENG
J.FENG 2023년 4월 6일
oh..sorry, I forget to clear workspace,and now it works.
Thanks a lot
Stephen23
Stephen23 2023년 4월 6일
@劍飛 馮: excellent, I am glad it worked. Please remember to click the accept button on my answer!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Tables에 대해 자세히 알아보기

태그

질문:

2023년 4월 6일

댓글:

2023년 4월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by