Hi, when I want to convart my empty array to a table:
TT = cell2table(cell(0,11));
TT.Properties.VariableNames = {'DepVar','GC','Reg','Type','n',' b','Pvalue','GCQ_T','ngrid','min_grid','max_grid'};
I get this error:
Error using matlab.internal.datatypes.parseArgs
No method 'parseArgs' with matching signature found.
Error in cell2table (line 31)
= matlab.internal.datatypes.parseArgs(pnames, dflts, varargin{:});
while i have done this befor and never got this error. I would appreciate it if you could help me solve this error or help me with any other solution to convert my empty 11 column array to a table with a specified name for each column.

댓글 수: 8

KALYAN ACHARJYA
KALYAN ACHARJYA 2021년 1월 6일
Why your question is NOT "urgent" or an "emergency"!
https://in.mathworks.com/matlabcentral/answers/29922-why-your-question-is-not-urgent-or-an-emergency
What shows up for
which -all matlab.internal.datatypes.parseArgs
You should see something like
>> which -all matlab.internal.datatypes.parseArgs
/Applications/MATLAB_R2020b.app/toolbox/matlab/datatypes/shared/matlab_datatypes/+matlab/+internal/+datatypes/parseArgs.m % static method or package function
Dear Walter Roberson, Thank you so much for your reply, when I run it I get this one :
>> which -all matlab.internal.datatypes.parseArgs
'matlab.internal.datatypes.parseArgs' not found.
Walter Roberson
Walter Roberson 2021년 1월 6일
Which MATLAB release are you using?
john wu
john wu 2021년 1월 6일
R2018a
Walter Roberson
Walter Roberson 2021년 1월 6일
I just checked in R2018a, and the function does exist. You might have a corrupt MATLAB, and probably need to reinstall.
john wu
john wu 2021년 1월 6일
is there any way other than re-installing ?
Walter Roberson
Walter Roberson 2021년 1월 6일
Yes, you could restore from the system backups you have been keeping.

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

답변 (1개)

Steven Lord
Steven Lord 2021년 1월 6일

1 개 추천

I would set the VariableNames as you're converting the cell array, not after the fact. I made it a 1-by-11 table so you could see the variable names.
TT = cell2table(cell(1,11), 'VariableNames', ...
{'DepVar','GC','Reg','Type','n',' b','Pvalue','GCQ_T','ngrid','min_grid','max_grid'})
TT = 1x11 table
DepVar GC Reg Type n b Pvalue GCQ_T ngrid min_grid max_grid ____________ ____________ ____________ ____________ ____________ ____________ ____________ ____________ ____________ ____________ ____________ {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double}

댓글 수: 8

john wu
john wu 2021년 1월 6일
편집: john wu 2021년 1월 6일
Dear Steven Lord, thank you for your answer. unfortunately I get a similar error:
Undefined variable "matlab" or class "matlab.internal.datatypes.parseArgs".
Error in cell2table (line 31)
= matlab.internal.datatypes.parseArgs(pnames, dflts, varargin{:});
I think the MATLAB I have for some reasons that I don't know, can't recognize the 'cell2table ()' , it used to work though.
Walter Roberson
Walter Roberson 2021년 1월 6일
It recognized cell2table() with no problem. cell2table() is calling upon the internal function matlab.internal.datatypes.parseArgs which does exist in R2018a, and the line number (31) of the error message does match the line number at which the function is called in R2018a -- so your cell2table.m is probably fine. But you are missing that internal routine.
john wu
john wu 2021년 1월 6일
would you please, give me instructions (or any file or link to follow) so i could solve the problem with the 'internal routin' you mentioned above or to 'restore from the system backups' that you mentioned in comments?
Walter Roberson
Walter Roberson 2021년 1월 6일
john wu
john wu 2021년 1월 6일
No I did not.
Rik
Rik 2021년 1월 6일
Then you are currently learning an important lesson: make sure you have a backup of anything you don't want to lose.
john wu
john wu 2021년 1월 6일
Thank you so much again for your time and help.

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

카테고리

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

질문:

2021년 1월 6일

댓글:

2021년 1월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by