headhead =dlnode with properties:Data: 1
Next: []
Prev: []nextNodenextNode =dlnode with properties:Data: 2
Next: []
Prev: []You can remove these nodes by clearing the variables:clear head nextNodeThe delete MethodThe delete method simply calls the clearList method:methods (Access = private)
function delete(node)
clearList(node)
end
endThe delete method has private access to prevent users from calling delete when
intending to delete a single node. MATLAB calls delete implicitly when the list is
destroyed.To delete a single node from the list, use the removeNode method.Specialize the dlnode Class
The dlnode class implements a doubly linked list and provides a convenient starting
point for creating more specialized types of linked lists. For example, suppose that you
want to create a list in which each node has a name.3 MATLAB Classes Overview