Financial Time Series Toolbox    
setfield

Set content of a specific field

Syntax

Description

setfield treats the contents of fields in a time series object (tsobj) as fields in a structure.

newfts = setfield(tsobj, field, V) sets the contents of the specified field to the value V. This is equivalent to the syntax S.field = V.

newfts = setfield(tsobj, field, {dates}, V) sets the contents of the specified field for the specified dates. dates can be individual cells of date strings or a cell of a date string range using the :: operator, e.g.,
'03/01/99::03/31/99'. Dates may contain time-of-day information.

Examples

Example 1. Set the closing value for all days to 3890.

Example 2. Set values for specific times on specific days.

First create a financial time series containing time-of-day data.

Now use setfield to replace the data in myfts with new data starting at 12:00 on January 1, 2001 and ending at 11:00 on January 3, 2001.

See Also

chfield, fieldnames, getfield, isfield, rmfield


  rsindex size