table()
has been a standard function in MATLAB since R2013b. As far as I can see from the documentation, there's nothing special about table
, compared to sum
, cell
, struct
, or any other builtin function.
However, when I try to run the function using builtin('table',var1,...varN)
I get an error saying:
Error using builtin
Cannot find builtin function 'table'
Investigating this further shows that it is in fact not considered a builtin function:
which('cell')
built-in (C:\Program Files\MATLAB\R2014b\toolbox\matlab\datatypes\cell)
which('table')
C:\Program Files\MATLAB\R2014b\toolbox\matlab\datatypes\@table\table.m % table constructor
|
Not builtin
Investigating further:
which cell2mat
C:\Program Files\MATLAB\R2014b\toolbox\matlab\datatypes\cell2mat.m
which mat2cell
C:\Program Files\MATLAB\R2014b\toolbox\matlab\datatypes\mat2cell.m
which table2array
C:\Program Files\MATLAB\R2014b\toolbox\matlab\datatypes\table2array.m
which struct2cell
built-in (C:\Program Files\MATLAB\R2014b\toolbox\matlab\datatypes\@struct\struct2cell) % struct method
which cell2struct
built-in (C:\Program Files\MATLAB\R2014b\toolbox\matlab\datatypes\@cell\cell2struct) % cell method
So, cell
is builtin while table
is not. cell2struct
is builtin while cell2mat
is not.
Why is this, and is there a simple way to call overloaded standard functions that aren't considered builtin by MATLAB?
If you think the why part is "too broad", please disregard it and jump to the last part of the question.