Main Content

plot

Draw 2-D line plot of DataMatrix object

Syntax

plot(DMObj1)
plot(DMObj1, DMObj2)
plot(..., LineSpec)

Arguments

DMObj1, DMObj2

DataMatrix objects, such as created by DataMatrix (object constructor).

Note

If both DMObj1 and DMObj2 are input arguments, one of the inputs can be a MATLAB® numeric array.

LineSpec

Character vector specifying a line style, marker symbol, and color of the plotted lines. For more information on these specifiers, see Line Specifications.

Description

plot(DMObj1) plots the columns of a DataMatrix object DMObj1 versus their index.

plot(DMObj1, DMObj2) plots the data from DMObj1 and DMObj2, two DataMatrix objects, or one DataMatrix object and one MATLAB numeric array.

  • If DMObj1 and DMObj2 are both vectors, they must have the same number of elements, and plot plots one vector versus the other vector, creating a single line.

  • If one is a vector and one a scalar, plot plots discrete points vertically or horizontally, at the scalar value.

  • If one is a vector and one a matrix, the number of elements in the vector must equal either the number of rows or the number of columns in the matrix, and plot plots the vector versus each row or column in the matrix.

  • If both are matrices, they must have the same size (number of rows and columns), and plot plots each column in DMObj1 versus the corresponding column in DMObj2.

plot(..., LineSpec) plots all lines as defined by LineSpec, a character vector specifying a line style, marker symbol, and/or color.

More About

collapse all

Version History

Introduced in R2008b

See Also

|