Clone Handle Object - using MATLAB OOP

버전 1.2.0.1 (4.95 KB) 작성자: Bobby Nedelkovski
How to clone an object (deep copy) which inherits reference behaviour from the 'handle' class.
다운로드 수: 1.7K
업데이트 날짜: 2016/9/1

라이선스 보기

The motivation for this demo is that if you have an instance (say 'a') of a custom class that subclasses 'handle', then the command 'b = a;' will produce another reference 'b' to the same object as initially referenced by 'a', effectively creating a 'shallow' copy of the object.
The link to this demo contains a test class which contains the code necessary to produce a clone or 'deep' copy of its instance by way of a method and alternatively, through its constructor.

A test script is provided to demonstrate the cloning of instances of the test class.

Written by Sam Oliver & Bobby Nedelkovski
The MathWorks Australia Pty Ltd
Copyright 2009, The MathWorks, Inc.

인용 양식

Bobby Nedelkovski (2024). Clone Handle Object - using MATLAB OOP (https://www.mathworks.com/matlabcentral/fileexchange/22965-clone-handle-object-using-matlab-oop), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2009b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Software Development Tools에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

copyHandleObj/

버전 게시됨 릴리스 정보
1.2.0.1

Updated license

1.2.0.0

Added copyright protection to Description field and associated files . Verified this item works with MATLAB R2009b.

1.1.0.0

This demo has been updated to use Dynamic Expressions when copying properties of an object.

1.0.0.0