Class Definition: tsdata.interpolation

datatypes: tsdata.interpolation

The interpolation method of a timeseries.

A tsdata.interpolation object names how a timeseries is evaluated between its samples, and holds the function that does it. It is what ts.DataInfo.Interpolation returns, and it is the value setinterpmethod sets.

Two methods are built in, 'linear' and 'zoh' (zero-order hold, which keeps each value until the next sample), and any function handle may be given instead.

Source Code: tsdata.interpolation

The tsdata.interpolation class contains the following properties:

A function handle called as newData = fh (newTime, oldTime, oldData), as in MATLAB: newTime and oldTime are column vectors, and oldData and newData have time along their first dimension, a sample per row. It is [] for an object that names no method. Assigning a function handle sets Name to 'myFuncHandle'.

MATLAB stores this property in several shapes, among them a cell holding the handle and, for a built-in method, a cell holding a handle and a function name; here it is always the handle itself.

One of 'linear', 'zoh' or 'myFuncHandle', or '' for an object that names no method. Assigning 'linear' or 'zoh' also sets Fhandle to the built-in function; 'myFuncHandle' is set by assigning a function handle to Fhandle, not by name. MATLAB accepts any name and leaves Fhandle as it was, so the two can disagree there.

The tsdata.interpolation class offers the following public methods:

tsdata.interpolation: ip = tsdata.interpolation ()

tsdata.interpolation: ip = tsdata.interpolation (name)

tsdata.interpolation: ip = tsdata.interpolation (fh)

ip = tsdata.interpolation () returns an object that names no method, with Name '' and Fhandle [].

ip = tsdata.interpolation (name) returns the built-in method name, 'linear' or 'zoh', given as a character vector or a string scalar.

ip = tsdata.interpolation (fh) returns a method evaluated by the function handle fh, called as newData = fh (newTime, oldTime, oldData), and names it 'myFuncHandle'.

A cell array is refused, where MATLAB returns an empty object for it without an error.

See also: timeseries, tsdata.datametadata

tsdata.interpolation: S = get (ip)

tsdata.interpolation: value = get (ip, name)

tsdata.interpolation: values = get (ip, names)

S = get (ip) returns a structure of every property of ip. value = get (ip, name) returns the property name, a character vector or a string scalar matched in any case, and values = get (ip, names) a row cell array of the properties named in the cell array names. For an array, one name gives a cell array of its size, and no name, or several, a cell array with a row per object and a column per property.

See also: tsdata.interpolation.set, timeseries.get

tsdata.interpolation: set (ip, name, value, …)

tsdata.interpolation: ip2 = set (ip, name, value, …)

tsdata.interpolation: S = set (ip)

set (ip, name, value, …) sets each property name, matched in any case, to its value, in the order given, in the variable ip of the caller, which must therefore be a variable. Metadata held by a timeseries is set with dot assignment instead, as ts.TimeInfo.Units = 'days'.

ip2 = set (ip, name, value, …) returns the modified object and leaves ip as it was. S = set (ip) returns what get (ip) does.

See also: tsdata.interpolation.get, timeseries.set