copy
Syntax
mobilityModelCopy = copy(mobilityModel)
Description
copies a mobility model object of a subclass of the mobilityModelCopy = copy(mobilityModel)wnet.Mobility class,
mobilityModel and returns the copied mobility model object,
mobilityModelCopy. The wnet.Mobility class
inherits the copy method from matlab.mixin.Copyable. The copy method enables you to create copies of objects of
subclasses derived from the wnet.Mobility base
class.
The copy method follows these rules:
The method creates a new handle object. Modifying the original object does not affect the copied object.
The method retains the default copy behavior of
matlab.mixin.Copyable:The method performs a shallow copy of all non-dependent properties.
The method does not invoke the constructor or any set methods when copying objects.
If your custom mobility object reads data from a file using a file identifier, do not initialize the identifier inside the constructor. If you do so and create a copy of your object, the copied object retains the same identifier as the original, since the
copymethod does not invoke the constructor.
Input Arguments
Output Arguments
Examples
For an example of the use of copy, see Implement Copy for Handle Classes.
Version History
Introduced in R2026a