Update class definition without clearing class instances

3 views (last 30 days)
As of R2018a, when a new class method is added to a classdef file, the class definition updates automatically, e.g.,
>> methods myclass
will list the new class method as soon as the modified classdef file is saved, without the need for any other kind of intervention. This is a great improvement over the days when a nuclear bomb like clear classes was necessary to do this kind of refresh (see this thread).
However, if the method is added in a separate file, within a @myclass folder, I find that it is still necessary to clear all objects of the class from the workspace. This is inconvenient of course, and I was wondering if there was any easier refresh procedure that I was unaware of. Issuing rehash() does not work. I reason that it must be possible to do this without a nuclear bomb, because it is already automatic when the class methods are implemented within a classdef file.

Answers (0)

Categories

Find more on Software Development Tools in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!