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

3 visualizaciones (últimos 30 días)
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?

Respuestas (0)

Categorías

Más información sobre Graphics Object Programming en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by