why do I get these errors ?

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 个评论

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.
Which MATLAB release are you using?
I just checked in R2018a, and the function does exist. You might have a corrupt MATLAB, and probably need to reinstall.
is there any way other than re-installing ?
Yes, you could restore from the system backups you have been keeping.

请先登录,再进行评论。

回答(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 个评论

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.
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.
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?
No I did not.
Then you are currently learning an important lesson: make sure you have a backup of anything you don't want to lose.
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