Clone Handle Object - using MATLAB OOP
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 릴리스 호환 정보
플랫폼 호환성
Windows macOS Linux카테고리
- MATLAB > Software Development Tools >
- MATLAB > Programming > Classes > Construct and Work with Object Arrays >
태그
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!