How to copy an object that is not a graphic one?
Afficher commentaires plus anciens
Hi,
I have an object of a class which I defined. I would like to make a copy of that object. But copy or copyobj do not seem to work. What should I do?
Thanks!
1 commentaire
JFz
le 13 Avr 2018
Réponse acceptée
Plus de réponses (1)
Steven Lord
le 13 Avr 2018
1 vote
Consider having your class subclass the matlab.mixin.Copyable class. It provides a copy method and a copyElement method that you can use to customize the copy behavior. For more information see the topic "Implement Copy for Handle Classes" in the documentation.
Catégories
En savoir plus sur Handle Classes and Object Life Cycle Management dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!