MATLAB: Remove completely an object inside another object

oop remove object

The property PipeBolt of the oject Bolt has several objects inside.
I can add new objects doing:
Bolt(1,1).PipeBolt(N,1) = newobj;
I can also delete an object doing:
Bolt(1,1).PipeBolt(N,1).delete
However the size of the Bolt(1,1).PipeBolt(N,1) will be the same before and after delete the object. I need to remove completely the object how can I do this?
Basically before I add a new object I have the size (3×1) but after delete the object I still have a 4×1 insted the original 3×1.
thank you in advance

Best Answer

You use the same rules to delete array elements regardless of their content, so:
Bolt(1, 1).PipeBolt(N, 1) = [];
Related Question