I am getting a "too many inputs" error when trying to cascade delete tables
Show older comments
alias_index = cellfun(...
@(ref_attr, attr) ~strcmp(ref_attr, attr), ...
fks.ref_attrs, fks.attrs, 'uni', true);
Error ID:
---------
'MATLAB:TooManyInputs'
--------------
Error Details:
--------------
Error using dj.Relvar>@(ref_attr,attr)~strcmp(ref_attr,attr)
Too many input arguments.
Error in dj.Relvar/del (line 101)
alias_index = cellfun(...
Error in TestCasDel/TestCasDel_testCasDelete (line 30)
del(TestLab.User & key)
3 Comments
Lei Hou
on 15 Feb 2022
Hi, Carlos,
Your syntax seems right. What is the value of fks.ref_attrs and fks.attrs? They are supposed to be cell array.
Thanks,
Lei
Carlos Ortiz
on 15 Feb 2022
Stephen23
on 16 Feb 2022
"Could you explain how the cellfun() method works with the ...@(x, y) and ~strcmp(x, y) function parameters?"
Those are not separate parameters, that is an anonymous function provided as the first argument:
The error in your question is most likely caused by this:
Answers (1)
Walter Roberson
on 16 Feb 2022
0 votes
fks is a non-scalar struct so struct expansion is occurring.
4 Comments
Carlos Ortiz
on 16 Feb 2022
Stephen23
on 16 Feb 2022
Walter Roberson
on 16 Feb 2022
Edited: Walter Roberson
on 16 Feb 2022
Possibly
alias_index = cellfun(...
@(ref_attr, attr) ~strcmp(ref_attr, attr), ...
{fks.ref_attrs}, {fks.attrs}, 'uni', true);
but it would not astonish me if ismember() needed to be used instead of strcmp()
Carlos Ortiz
on 21 Feb 2022
Categories
Find more on Whos in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!