Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

plot::copy

Make a physical copy of a plot object

MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

Syntax

plot::copy(obj)

Description

Objects created from inside the plot library have a reference effect: If you make another reference to some object, say by calling o2 := o1; and then change an attribute of o2, for example, setting o2::Visible := FALSE, this change will also effect the object referred to by o1, because they actually refer to the same object. To create an actual copy of an object instead, use o2 := plot::copy(o1);.

Examples

Example 1

The following call does not create two points, but rather one which we can access by two names:

A := plot::Point2d(0, 0):
B := A:

This becomes obvious when you try to modify one of the points:

B::Position := [1, 1]:
A

To copy a point, use plot::copy :

B := plot::copy(A):
B::Position := [2, 2]:
A, B

Parameters

obj

Plot objects

Return Values

Object of the same type as obj

See Also

MuPAD Functions

Was this topic helpful?