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.

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Plot discrete sequence data

`stem(`

plots the
data sequence, `Y`

)`Y`

, as stems that extend from a baseline
along the *x*-axis. The data values are indicated
by circles terminating each stem.

If

`Y`

is a vector, then the*x*-axis scale ranges from 1 to`length(Y)`

.If

`Y`

is a matrix, then`stem`

plots all elements in a row against the same*x*value, and the*x*-axis scale ranges from 1 to the number of rows in`Y`

.

`stem(`

plots
the data sequence, `X`

,`Y`

)`Y`

, at values specified by `X`

.
The `X`

and `Y`

inputs must be vectors
or matrices of the same size. Additionally, `X`

can
be a row or column vector and `Y`

must be a matrix
with `length(X)`

rows.

If

`X`

and`Y`

are both vectors, then`stem`

plots entries in`Y`

against corresponding entries in`X`

.If

`X`

is a vector and`Y`

is a matrix, then`stem`

plots each column of`Y`

against the set of values specified by`X`

, such that all elements in a row of`Y`

are plotted against the same value.If

`X`

and`Y`

are both matrices, then`stem`

plots columns of`Y`

against corresponding columns of`X`

.

`stem(___,`

fills
the circles. Use this option with any of the input argument combinations
in the previous syntaxes.`'filled'`

)

`stem(___,`

specifies
stem series properties using one or more `Name,Value`

)`Name,Value`

pair
arguments.

Was this topic helpful?