Is there a method to make a copy of an object of a class inheriting from the handle class in MATLAB 7.6 (R2008a) ?

2 views (last 30 days)
I would like to make a copy of an object of the MATLAB handle class – and I would like to know which method I can use to do this.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 20 Jun 2011
This enhancement has been incorporated in Release 2011a (R2011a). For previous product releases, read below for any possible workarounds:
There is no method to this in MATLAB 7.6 (R2008a). You could create a default copy method that just copies properties according to the way values are copied. This method could be put this in a base class.
However, this should be avoided as in "handle" class because handles are most often used to represent unique classes (like Simulink blocks or Handle graphic objects) where it is not possible (or allowed) for all properties of the class to have exactly the same values in 2 or more instances.

More Answers (0)

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Products


Release

R2008a

Community Treasure Hunt

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

Start Hunting!