How to initialize optional struct/class input variables in the "arguments" block?
Mostra commenti meno recenti
I defined a function in the following form
function [obj] = func(obj, aa, bb, cc, dd)
arguments
obj;
aa;
bb = 'bb';
cc = obj.c;
dd.dd1 = ones(obj.dd1);
dd.dd2 = 2;
end
end
where "dd" can be a struct/class type optional input variable. By executing the following command
obj = func(obj, aa, bb, cc, dd)
I ran into the following error.
Error using xxx func
Invalid argument at position 5. Function requires 2 to 4 positional input(s).
How can I fix the error?
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Automotive in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!