Grocer Function

NAME

reshape - creation of a ts from a vector

CALLING SEQUENCE

ts=reshape(mat,datin)

PARAMETERS

Input

Output

DESCRIPTION

Creates a time series from a vector of values and a beginning date.

EXAMPLE

1) x = reshape([21:44],'1a')
2) x = reshape([1:24]','1985q1')
3) x = reshape(y,'1985f2d2')

Example 1 creates an annual ts, from the year 1 to the year 24, with values 21 to 44.
Example 2 creates a quarterly ts, from the first quarter of 1985 to the last quarter of 2000, with values 1 to 24.
Note that the data are given as a row vector in example 1 and a column vector in example 2: it doesn't matter, provided that you don't give a matrix with more than one dimension.
Example 3 creates a half-yearly ts, from the second half-year of 1985 until a date determined by the length of the -supposed-vector y and with values equal to that of vector y.

AUTHOR

Eric Dubois 2002