# histogram

**Installation Required:** This functionality requires MATLAB Support Package for Quantum Computing.

## Description

`histogram(`

plots a histogram of each
possible state and its probability from the specified quantum state or measurement. The
input `s`

)`s`

must be a `QuantumState`

or
`QuantumMeasurement`

object.

If

`s`

is a`QuantumState`

object, then`histogram`

plots each possible state and the probability of measuring that state.If

`s`

is a`QuantumMeasurement`

object, then`histogram`

plots each measured state and the estimated probability of that state.

`histogram(___,`

specifies options using one or more name-value arguments in addition to any of the input
argument combinations in previous syntaxes. For example, you can choose the basis in which
each qubit is represented or a probability threshold to include states in the
histogram.`Name=Value`

)

also returns a
`h`

= histogram(___)`Histogram`

object. Use this object to inspect and adjust the properties
of the histogram. For a list of properties, see Histogram Properties.

## Examples

## Input Arguments

## Tips

To return the possible states and their probabilities, you can use

`querystates`

. The`querystates`

function (with two output arguments) has the same syntaxes as`histogram`

.

## Version History

**Introduced in R2023a**