%% Delete Graphics Objects
% Delete a graphics object and a graphics object array.
% Create a bar chart and plot five lines. Then delete the bar chart.

b = bar(1:5);
hold on
P = plot(magic(5));
delete(b)

%
% The Bar object variable b remains in the workspace, but no longer refers to an object.

display(b)

%
% Delete all the Line objects created by plot.

delete(P)