Financial Time Series | ![]() ![]() |
Set content of a specific field
Syntax
newfts = setfield(tsobj
, field, V) newfts = setfield(tsobj
, field, {dates}, V)
Description
setfield
treats the contents of fields in a time series object (tsobj
) as fields in a structure.
newfts = setfield(
sets the contents of the specified field to the value tsobj
, field, V)
V
. This is equivalent to the syntax S.field = V
.
newfts = setfield(
sets the contents of the specified field for the specified dates. tsobj
, field, {dates}, V)
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'
.
Example
load dji30short oldfieldnames = fieldnames(myfts1) myfts1 = setfield(myfts1, 'Dividend', 0.025); newfieldnames = fieldnames(myfts1)
See Also
chfield
, fieldnames
, getfield
, isfield
, rmfield
![]() | rsindex | size | ![]() |