I faced the following error when i use "table" command to create and empty table:
my_results = table
Error using ones
Invalid default value for property 'metaDim' in class 'table':
Size inputs must be scalar.
Error in all (line 68)
sz = [sz,ones(1,DIM-length(sz))];
Error in matlab.internal.tabular.private.metaDim (line 45)
if ~(isCharStrings(labels,true) && all(strlength(labels) > 0, 'all')) % require cellstr, whitespace, but not empty allowed
any suggestion?

 채택된 답변

Star Strider
Star Strider 2022년 3월 7일

0 개 추천

To preallocate a table see the documentation section on Specify Size and Variable Types since an empty table nevertheless has specific requirements for its construction.

댓글 수: 4

Reza Zomorodi
Reza Zomorodi 2022년 3월 7일
Thank you for your prompt reply.
That's right. preallocate /define table would help. But without pre-defining the raw /colum Matlab offers another way: "Create an empty table" . However, running the example from Matlab-help generates the same error.
Star Strider
Star Strider 2022년 3월 7일
I cannot find ‘Create an empty table’ in the R2021b documentation for table, so that option may have been removed. I can only find the documentation section I linked to.
Reza Zomorodi
Reza Zomorodi 2022년 3월 7일
Thats' right. i developed the scpirt in 2018b and faced this error in 2021b. Thank you for your help!
Star Strider
Star Strider 2022년 3월 7일
My pleasure!

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

추가 답변 (1개)

Peter Perkins
Peter Perkins 2022년 3월 7일

0 개 추천

Reza, if that's really what you get in the command window, and you have not left anythng out, then you either have something else named "table", or you have something seriously wrong with your MATLAB install.

카테고리

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

제품

릴리스

R2018b

태그

질문:

2022년 3월 7일

댓글:

2022년 3월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by