-
Notifications
You must be signed in to change notification settings - Fork 1
/
subts.m
executable file
·30 lines (29 loc) · 930 Bytes
/
subts.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
function dat=subts(ts,sy,sp,ey,ep,varargin)
%SUBTS returns a subset of the tsmat over the period specified
%
% dat=subts(ts,sy,sp,ey,ep,varargin)
%
% Example:
% dat=subts(ts,1980,1,1985,12) returns the ts(1980,1,1985,12,:)
% if nargin==5 ---> returns an array with only the data
% if nargin==6 ---> returns an array with dates (in numeric format) and data
% see also
%
% BITS - Banca d'Italia Time Series
% Copyright 2005-2012 Banca d'Italia - Area Ricerca Economica e Relazioni Internazionali
%
% Author: Emmanuele Somma (emmanuele_DOT_somma_AT_bancaditalia_DOT_it)
% Area Ricerca Economica e Relazioni Internazionali
% Banca d'Italia
%
sottots=ts(sy,sp,ey,ep,:);
if nargin<6
dat=sottots;
elseif nargin==6
dati=sottots.matdata;
dat=[dati];
elseif nargin==7;
dates=sottots.dates;
dati=sottots.matdata;
dat=[dates,dati];
end