Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

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.

sortfts

Sort financial time series

Syntax

sfts = sortfts(tsobj)
sfts = sortfts(tsobj, flag)
sfts = sortfts(tsobj, seriesnames, flag)
[sfts, sidx] = sortfts(...)

Arguments

tsobj

Financial time series object.

flag

(Optional) Sort order:

flag = 1; increasing order (default)

flag = -1; decreasing order

seriesnames

(Optional) Character vector containing a data series name or cell array of character vectors containing a list of data series names.

Description

sfts = sortfts(tsobj) sorts the financial time series object tsobj in increasing order based only upon the 'dates' vector if tsobj does not contain time-of-day information. If the object includes time-of-day information, the sort is based upon a combination of the 'dates' and 'times' vectors. The 'times' vector cannot be sorted individually.

sfts = sortfts(tsobj, flag) sets the order of the sort. flag = 1: increasing date and time order. flag = -1: decreasing date and time order.

sfts = sortfts(tsobj, seriesnames, flag) sorts the financial time series object tsobj based upon the data series name(s) seriesnames. The seriesnames argument can be a single character vector containing a data series name or a cell array of character vectors containing a list of data series names. If the optional flag is set to -1, the sort is in decreasing order.

[sfts, sidx] = sortfts(...) also returns the index of the original object tsobj sorted based on 'dates' or specified data series name(s).

Introduced before R2006a

Was this topic helpful?