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 Kommentare

KALYAN ACHARJYA
KALYAN ACHARJYA am 6 Jan. 2021
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
john wu
john wu am 6 Jan. 2021
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 am 6 Jan. 2021
Which MATLAB release are you using?
john wu
john wu am 6 Jan. 2021
R2018a
Walter Roberson
Walter Roberson am 6 Jan. 2021
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 am 6 Jan. 2021
is there any way other than re-installing ?
Walter Roberson
Walter Roberson am 6 Jan. 2021
Yes, you could restore from the system backups you have been keeping.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Steven Lord
Steven Lord am 6 Jan. 2021

1 Stimme

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 Kommentare

john wu
john wu am 6 Jan. 2021
Bearbeitet: john wu am 6 Jan. 2021
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 am 6 Jan. 2021
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 am 6 Jan. 2021
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 am 6 Jan. 2021
john wu
john wu am 6 Jan. 2021
No I did not.
Rik
Rik am 6 Jan. 2021
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 am 6 Jan. 2021
Thank you so much again for your time and help.

Melden Sie sich an, um zu kommentieren.

Gefragt:

am 6 Jan. 2021

Kommentiert:

am 6 Jan. 2021

Community Treasure Hunt

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

Start Hunting!

Translated by