hist

Syntax

hist(tsobj, numbins)
ftshist = hist(tsobj, numbins)
[ftshist, binpos] = hist(tsobj, numbins)

Arguments

tsobj

Financial time series object.

numbins

(Optional) Number of histogram bins. Default = 10.

Description

hist(tsobj, numbins) calculates and displays the histogram of the data series contained in the financial time series object tsobj.

ftshist = hist(tsobj, numbins) calculates, but does not display, the histogram of the data series contained in the financial time series object tsobj. The output ftshist is a structure with field names similar to the data series names of tsobj.

[ftshist, binpos] = hist(tsobj, numbins) additionally returns the bin positions binpos. The positions are the centers of each bin. binpos is a column vector.

Examples

expand all

Create a Histogram

This example shows how to generate a histogram of Disney open, high, low, and close prices.

load disney.mat
dis = rmfield(dis,'VOLUME'); % Remove VOLUME field
hist(dis)
title('Disney Histogram')

See Also

| |

Was this topic helpful?