copy a dynamicprops object by value

3 ビュー (過去 30 日間)
Yvan Lengwiler
Yvan Lengwiler 2015 年 1 月 26 日
コメント済み: Fernando 2023 年 11 月 2 日
I've created a class that is a subclass of dynamicprops,
classdef myclass < dynamicprops
When I create an instance of this
c = myclass
and then copy this
d = c
then d and c refer to the same underlying object. Therefore, whenever I change a property of c, the corresponding property of d changes as well (because c and d really refer to the same thing).
Question 1. How can I make a "real" independent copy of c?
Question 2. Alternatively, can I adapt the class definition so that it will be copied "by value" and not "by reference" ?
Thanks for your help.
  1 件のコメント
Fernando
Fernando 2023 年 11 月 2 日
I wish somebody would answer this.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeHandle Classes についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by