delobject
No License
DELETE OBJECT
DELOBJECT( H ) deletes the object with handle h, but is more forgiving
than DELETE: when h is empty, zero or not valid, no action is taken.
Additionally, DELOBJECT enables deletion of multiple handles at the same
time:
- H can be an array of handles; all objects are deleted.
- H can be a cell array of handles.
- H can be a struct, in which case each field is assumed a handle.
- Each element in the cell array and each field in the struct can be an
array of handles. Note that using cells and structs is slower than a
numeric array of handles.
Example:
h = 0;
hf = figure; hold on;
axis([-15 15 -15 15]); axis equal;
for i=1:10;
x = sin(0:0.1:2*pi);
y = cos(0:0.1:2*pi);
delobject(h);
h.red = plot( x,y+i,'r');
h.blue = plot( x,y-i,'g');
pause(0.5);
end
delobject(hf);
Cite As
Almar Klein (2026). delobject (https://www.mathworks.com/matlabcentral/fileexchange/16838-delobject), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- MATLAB > Programming > Classes > Define Classes > Handle Classes >
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0.0 | description was insufficient |
