How to addParameter and validateattributes for several values at once (OOP)?

3 visualizzazioni (ultimi 30 giorni)
Basically I have the MainObject and I want to add to this object the Obj1 (FilterObj) e Obj2 (RotObj). When I just need to add one object I do something like:
function set.PipeBolt(obj,val)
if ~isempty(val)
validateattributes(val, {'FilterObj'},{'size',[NaN,1]});
else
val = FilterObj.empty;
end
obj.PipeBolt = val;
end
and in constructer something like
addParameter(parser,'PipeBolt',FilterObj.empty,@(x)validateattributes(x,'{FilterObj'},'PipeLineBolt','PipeBolt'))
let say that FilterObj is Obj1 but for Obj1 (RotObj) how can I adjust the code to pass and validate atributes both types of objects?

Risposte (0)

Categorie

Scopri di più su Graphics Object Programming in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by