I have two classes, Plant and Generator. Generator creates a vector and broadcasts it via notify(), which Plant
Perhaps I'm resurrecting a 2 year old question, but...
Matlab wants to call the destructor on clear; the problem is in how you've defined your listener. You defined it as:
obj.plant.Listener = addlistener(obj, 'newSignal', ...
@(src, data) obj.plant.ListenerCallback(data));
In doing so, you've created an anonymous function that has a hardcoded reference to obj. When obj goes out of scope elsewhere (e.g. via clearing in the base workspace), it still continues to exist in your anonymous function. If you instead define:
obj.plant.Listener = addlistener(obj, 'newSignal', ...
@(src, data) src.plant.ListenerCallback(data));
there's no hardcoded references in the anonymous function. The first argument to the listener callback is always the object it was invoked from, but you get it on the fly rather than hardcoding an object reference in an anonymous function.
Hope this is still of some value to you!