Main Content

hist

Histogram for financial time series object

hist is not recommended. Use timetable instead. For more information, see Convert Financial Time Series Objects fints to Timetables.

Description

example

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

example

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.

example

[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

collapse all

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)
Warning: FINTS is not recommended. Use TIMETABLE instead. For more information, see <a href="matlab:web(fullfile(docroot, 'finance/convert-from-fints-to-timetables.html'))">Convert Financial Time Series Objects (fints) to Timetables</a>.
title('Disney Histogram')

Figure contains an axes object. The axes object with title Disney Histogram contains 4 objects of type patch.

Input Arguments

collapse all

Financial time series object, specified as a fints object.

Data Types: object

(Optional) Number of histogram bins, specified as a positive numeric.

Data Types: double

Output Arguments

collapse all

Field names similar to the data series names of tsobj, returned as a structure.

Bin positions for centers of bins, returned as a column vector.

Version History

Introduced before R2006a