matlab.mixin.Copyable.copy - Copy array of handle objects - MATLAB (original) (raw)
Main Content
Class: matlab.mixin.Copyable
Namespace: matlab.mixin
Copy array of handle objects
Description
B = copy([A](#mw%5F3bb65c74-bd16-4d4f-b7da-d4ea85861620))
copies each element in the array of handles A
to a new array of handles B
.
The copy
method follows these rules:
- The
copy
method does not copy dependent properties. - MATLABĀ® does not call the
copy
method recursively on any handles contained in property values. - MATLAB does not call the class constructor or property set methods during the copy operation.
B
has the same size and number of elements asA
.B
is the same class asA
.- If
A
is empty,B
is also empty. - If
A
is heterogeneous,B
is also heterogeneous. - If
A
contains deleted handle objects,copy
creates deleted handles of the same class inB
. - Dynamic properties and listeners associated with objects in
A
are not copied to objects inB
.
Input Arguments
Handle object array to be copied.
Examples
For an example of the use of copy
, see Implement Copy for Handle Classes.
Version History
Introduced in R2011a