Sos! indexing the time series object?

  • Follow


K>> myfts = fints((datenum('07/01/98'):datenum('07/01/98')+4)',...
[1234.56; 2345.61; 3456.12; 4561.23; 5612.34], [], 'Daily',...
'Data Reference');
K>>
K>>
K>> myfts

myfts =

    desc:  Data Reference
    freq:  Daily (1)

    'dates:  (5)'    'series1:  (5)'
    '01-Jul-1998'    [  1.2346e+003]
    '02-Jul-1998'    [  2.3456e+003]
    '03-Jul-1998'    [  3.4561e+003]
    '04-Jul-1998'    [  4.5612e+003]
    '05-Jul-1998'    [  5.6123e+003]

K>> myfts({'01-Jul-1998', '02-Jul-1998'})
??? Error using ==> subsindex
Function 'subsindex' is not defined for values of class 'cell'.

K>> myfts(['01-Jul-1998', '02-Jul-1998'])
??? Index exceeds matrix dimensions.

K>> myfts(['01-Jul-1998'; '02-Jul-1998'])
??? Index exceeds matrix dimensions.

K>> myfts({'01-Jul-1998'; '02-Jul-1998'})
??? Error using ==> subsindex
Function 'subsindex' is not defined for values of class 'cell'.

K>> myfts({'07/01/1998'})
??? Error using ==> subsindex
Function 'subsindex' is not defined for values of class 'cell'.

K>> myfts('07/01/1998')
??? Index exceeds matrix dimensions.

K>> myfts('07/01/98')
??? Index exceeds matrix dimensions.

-----------------

How do I index a bunch of dates all at once from a time series object?

Thanks!
0
Reply lunamoonmoon (258) 2/11/2010 5:19:14 PM

Luna Moon <lunamoonmoon@gmail.com> wrote in message <6bc87d6c-16c0-4aa8-8c4a-d94ea38079c0@z1g2000vbo.googlegroups.com>...
> K>> myfts = fints((datenum('07/01/98'):datenum('07/01/98')+4)',...
> [1234.56; 2345.61; 3456.12; 4561.23; 5612.34], [], 'Daily',...
> 'Data Reference');
> K>>
> K>>
> K>> myfts
> 
> myfts =
> 
>     desc:  Data Reference
>     freq:  Daily (1)
> 
>     'dates:  (5)'    'series1:  (5)'
>     '01-Jul-1998'    [  1.2346e+003]
>     '02-Jul-1998'    [  2.3456e+003]
>     '03-Jul-1998'    [  3.4561e+003]
>     '04-Jul-1998'    [  4.5612e+003]
>     '05-Jul-1998'    [  5.6123e+003]
> 
> K>> myfts({'01-Jul-1998', '02-Jul-1998'})
> ??? Error using ==> subsindex
> Function 'subsindex' is not defined for values of class 'cell'.
> 
> K>> myfts(['01-Jul-1998', '02-Jul-1998'])
> ??? Index exceeds matrix dimensions.
> 
> K>> myfts(['01-Jul-1998'; '02-Jul-1998'])
> ??? Index exceeds matrix dimensions.
> 
> K>> myfts({'01-Jul-1998'; '02-Jul-1998'})
> ??? Error using ==> subsindex
> Function 'subsindex' is not defined for values of class 'cell'.
> 
> K>> myfts({'07/01/1998'})
> ??? Error using ==> subsindex
> Function 'subsindex' is not defined for values of class 'cell'.
> 
> K>> myfts('07/01/1998')
> ??? Index exceeds matrix dimensions.
> 
> K>> myfts('07/01/98')
> ??? Index exceeds matrix dimensions.
> 
> -----------------
> 
> How do I index a bunch of dates all at once from a time series object?
> 
> Thanks!

>> myfts(1:2)
 
ans = 
 
    desc:  Data Reference
    freq:  Daily (1)

    'dates:  (2)'    'series1:  (2)'
    '01-Jul-1998'    [  1.2346e+003]
    '02-Jul-1998'    [  2.3456e+003]

>> myfts.dates

ans =

      729937
      729938
      729939
      729940
      729941

>> myfts.dates(2:4)

ans =

      729938
      729939
      729940
0
Reply donn.shull.no_spam (336) 2/11/2010 5:38:04 PM


On Feb 11, 12:38=A0pm, "Donn Shull" <donn.shull.no_s...@aetoolbox.com>
wrote:
> Luna Moon <lunamoonm...@gmail.com> wrote in message <6bc87d6c-16c0-4aa8-8=
c4a-d94ea3807...@z1g2000vbo.googlegroups.com>...
> > K>> myfts =3D fints((datenum('07/01/98'):datenum('07/01/98')+4)',...
> > [1234.56; 2345.61; 3456.12; 4561.23; 5612.34], [], 'Daily',...
> > 'Data Reference');
> > K>>
> > K>>
> > K>> myfts
>
> > myfts =3D
>
> > =A0 =A0 desc: =A0Data Reference
> > =A0 =A0 freq: =A0Daily (1)
>
> > =A0 =A0 'dates: =A0(5)' =A0 =A0'series1: =A0(5)'
> > =A0 =A0 '01-Jul-1998' =A0 =A0[ =A01.2346e+003]
> > =A0 =A0 '02-Jul-1998' =A0 =A0[ =A02.3456e+003]
> > =A0 =A0 '03-Jul-1998' =A0 =A0[ =A03.4561e+003]
> > =A0 =A0 '04-Jul-1998' =A0 =A0[ =A04.5612e+003]
> > =A0 =A0 '05-Jul-1998' =A0 =A0[ =A05.6123e+003]
>
> > K>> myfts({'01-Jul-1998', '02-Jul-1998'})
> > ??? Error using =3D=3D> subsindex
> > Function 'subsindex' is not defined for values of class 'cell'.
>
> > K>> myfts(['01-Jul-1998', '02-Jul-1998'])
> > ??? Index exceeds matrix dimensions.
>
> > K>> myfts(['01-Jul-1998'; '02-Jul-1998'])
> > ??? Index exceeds matrix dimensions.
>
> > K>> myfts({'01-Jul-1998'; '02-Jul-1998'})
> > ??? Error using =3D=3D> subsindex
> > Function 'subsindex' is not defined for values of class 'cell'.
>
> > K>> myfts({'07/01/1998'})
> > ??? Error using =3D=3D> subsindex
> > Function 'subsindex' is not defined for values of class 'cell'.
>
> > K>> myfts('07/01/1998')
> > ??? Index exceeds matrix dimensions.
>
> > K>> myfts('07/01/98')
> > ??? Index exceeds matrix dimensions.
>
> > -----------------
>
> > How do I index a bunch of dates all at once from a time series object?
>
> > Thanks!
> >> myfts(1:2)
>
> ans =3D
>
> =A0 =A0 desc: =A0Data Reference
> =A0 =A0 freq: =A0Daily (1)
>
> =A0 =A0 'dates: =A0(2)' =A0 =A0'series1: =A0(2)'
> =A0 =A0 '01-Jul-1998' =A0 =A0[ =A01.2346e+003]
> =A0 =A0 '02-Jul-1998' =A0 =A0[ =A02.3456e+003]
>
> >> myfts.dates
>
> ans =3D
>
> =A0 =A0 =A0 729937
> =A0 =A0 =A0 729938
> =A0 =A0 =A0 729939
> =A0 =A0 =A0 729940
> =A0 =A0 =A0 729941
>
> >> myfts.dates(2:4)
>
> ans =3D
>
> =A0 =A0 =A0 729938
> =A0 =A0 =A0 729939
> =A0 =A0 =A0 729940- Hide quoted text -
>
> - Show quoted text -

No, I have to use either datenumbers or datestrings to index the time
series object, I don't want to use something like (2:4), that's not
convenient;

I would like to find a way to index the time series arbitrarily by
date string and/or date numbers...

Thanks!
0
Reply lunamoonmoon (258) 2/11/2010 6:09:33 PM

On Feb 11, 1:09=A0pm, Luna Moon <lunamoonm...@gmail.com> wrote:
> On Feb 11, 12:38=A0pm, "Donn Shull" <donn.shull.no_s...@aetoolbox.com>
> wrote:
>
>
>
>
>
> > Luna Moon <lunamoonm...@gmail.com> wrote in message <6bc87d6c-16c0-4aa8=
-8c4a-d94ea3807...@z1g2000vbo.googlegroups.com>...
> > > K>> myfts =3D fints((datenum('07/01/98'):datenum('07/01/98')+4)',...
> > > [1234.56; 2345.61; 3456.12; 4561.23; 5612.34], [], 'Daily',...
> > > 'Data Reference');
> > > K>>
> > > K>>
> > > K>> myfts
>
> > > myfts =3D
>
> > > =A0 =A0 desc: =A0Data Reference
> > > =A0 =A0 freq: =A0Daily (1)
>
> > > =A0 =A0 'dates: =A0(5)' =A0 =A0'series1: =A0(5)'
> > > =A0 =A0 '01-Jul-1998' =A0 =A0[ =A01.2346e+003]
> > > =A0 =A0 '02-Jul-1998' =A0 =A0[ =A02.3456e+003]
> > > =A0 =A0 '03-Jul-1998' =A0 =A0[ =A03.4561e+003]
> > > =A0 =A0 '04-Jul-1998' =A0 =A0[ =A04.5612e+003]
> > > =A0 =A0 '05-Jul-1998' =A0 =A0[ =A05.6123e+003]
>
> > > K>> myfts({'01-Jul-1998', '02-Jul-1998'})
> > > ??? Error using =3D=3D> subsindex
> > > Function 'subsindex' is not defined for values of class 'cell'.
>
> > > K>> myfts(['01-Jul-1998', '02-Jul-1998'])
> > > ??? Index exceeds matrix dimensions.
>
> > > K>> myfts(['01-Jul-1998'; '02-Jul-1998'])
> > > ??? Index exceeds matrix dimensions.
>
> > > K>> myfts({'01-Jul-1998'; '02-Jul-1998'})
> > > ??? Error using =3D=3D> subsindex
> > > Function 'subsindex' is not defined for values of class 'cell'.
>
> > > K>> myfts({'07/01/1998'})
> > > ??? Error using =3D=3D> subsindex
> > > Function 'subsindex' is not defined for values of class 'cell'.
>
> > > K>> myfts('07/01/1998')
> > > ??? Index exceeds matrix dimensions.
>
> > > K>> myfts('07/01/98')
> > > ??? Index exceeds matrix dimensions.
>
> > > -----------------
>
> > > How do I index a bunch of dates all at once from a time series object=
?
>
> > > Thanks!
> > >> myfts(1:2)
>
> > ans =3D
>
> > =A0 =A0 desc: =A0Data Reference
> > =A0 =A0 freq: =A0Daily (1)
>
> > =A0 =A0 'dates: =A0(2)' =A0 =A0'series1: =A0(2)'
> > =A0 =A0 '01-Jul-1998' =A0 =A0[ =A01.2346e+003]
> > =A0 =A0 '02-Jul-1998' =A0 =A0[ =A02.3456e+003]
>
> > >> myfts.dates
>
> > ans =3D
>
> > =A0 =A0 =A0 729937
> > =A0 =A0 =A0 729938
> > =A0 =A0 =A0 729939
> > =A0 =A0 =A0 729940
> > =A0 =A0 =A0 729941
>
> > >> myfts.dates(2:4)
>
> > ans =3D
>
> > =A0 =A0 =A0 729938
> > =A0 =A0 =A0 729939
> > =A0 =A0 =A0 729940- Hide quoted text -
>
> > - Show quoted text -
>
> No, I have to use either datenumbers or datestrings to index the time
> series object, I don't want to use something like (2:4), that's not
> convenient;
>
> I would like to find a way to index the time series arbitrarily by
> date string and/or date numbers...
>
> Thanks!- Hide quoted text -
>
> - Show quoted text -

It should be okay according to this webpage:

http://www.mathworks.com/access/helpdesk/help/toolbox/finance/subsref.html

0
Reply lunamoonmoon (258) 2/11/2010 6:11:34 PM

Luna Moon <lunamoonmoon@gmail.com> wrote in message <4dabef60-a89b-4f21-b3e4-7e10967a1d5c@o3g2000vbo.googlegroups.com>...
> On Feb 11, 1:09 pm, Luna Moon <lunamoonm...@gmail.com> wrote:
> > On Feb 11, 12:38 pm, "Donn Shull" <donn.shull.no_s...@aetoolbox.com>
> > wrote:
> >
> >
> >
> >
> >
> > > Luna Moon <lunamoonm...@gmail.com> wrote in message <6bc87d6c-16c0-4aa8-8c4a-d94ea3807...@z1g2000vbo.googlegroups.com>...
> > > > K>> myfts = fints((datenum('07/01/98'):datenum('07/01/98')+4)',...
> > > > [1234.56; 2345.61; 3456.12; 4561.23; 5612.34], [], 'Daily',...
> > > > 'Data Reference');
> > > > K>>
> > > > K>>
> > > > K>> myfts
> >
> > > > myfts =
> >
> > > >     desc:  Data Reference
> > > >     freq:  Daily (1)
> >
> > > >     'dates:  (5)'    'series1:  (5)'
> > > >     '01-Jul-1998'    [  1.2346e+003]
> > > >     '02-Jul-1998'    [  2.3456e+003]
> > > >     '03-Jul-1998'    [  3.4561e+003]
> > > >     '04-Jul-1998'    [  4.5612e+003]
> > > >     '05-Jul-1998'    [  5.6123e+003]
> >
> > > > K>> myfts({'01-Jul-1998', '02-Jul-1998'})
> > > > ??? Error using ==> subsindex
> > > > Function 'subsindex' is not defined for values of class 'cell'.
> >
> > > > K>> myfts(['01-Jul-1998', '02-Jul-1998'])
> > > > ??? Index exceeds matrix dimensions.
> >
> > > > K>> myfts(['01-Jul-1998'; '02-Jul-1998'])
> > > > ??? Index exceeds matrix dimensions.
> >
> > > > K>> myfts({'01-Jul-1998'; '02-Jul-1998'})
> > > > ??? Error using ==> subsindex
> > > > Function 'subsindex' is not defined for values of class 'cell'.
> >
> > > > K>> myfts({'07/01/1998'})
> > > > ??? Error using ==> subsindex
> > > > Function 'subsindex' is not defined for values of class 'cell'.
> >
> > > > K>> myfts('07/01/1998')
> > > > ??? Index exceeds matrix dimensions.
> >
> > > > K>> myfts('07/01/98')
> > > > ??? Index exceeds matrix dimensions.
> >
> > > > -----------------
> >
> > > > How do I index a bunch of dates all at once from a time series object?
> >
> > > > Thanks!
> > > >> myfts(1:2)
> >
> > > ans =
> >
> > >     desc:  Data Reference
> > >     freq:  Daily (1)
> >
> > >     'dates:  (2)'    'series1:  (2)'
> > >     '01-Jul-1998'    [  1.2346e+003]
> > >     '02-Jul-1998'    [  2.3456e+003]
> >
> > > >> myfts.dates
> >
> > > ans =
> >
> > >       729937
> > >       729938
> > >       729939
> > >       729940
> > >       729941
> >
> > > >> myfts.dates(2:4)
> >
> > > ans =
> >
> > >       729938
> > >       729939
> > >       729940- Hide quoted text -
> >
> > > - Show quoted text -
> >
> > No, I have to use either datenumbers or datestrings to index the time
> > series object, I don't want to use something like (2:4), that's not
> > convenient;
> >
> > I would like to find a way to index the time series arbitrarily by
> > date string and/or date numbers...
> >
> > Thanks!- Hide quoted text -
> >
> > - Show quoted text -
> 
> It should be okay according to this webpage:
> 
> http://www.mathworks.com/access/helpdesk/help/toolbox/finance/subsref.html

>>  myfts('01-Jul-1998::02-Jul-1998')
 
ans = 
 
    desc:  Data Reference
    freq:  Daily (1)

    'dates:  (2)'    'series1:  (2)'
    '01-Jul-1998'    [  1.2346e+003]
    '02-Jul-1998'    [  2.3456e+003]

>> myfts('07/01/98::07/02/98')
 
ans = 
 
    desc:  Data Reference
    freq:  Daily (1)

    'dates:  (2)'    'series1:  (2)'
    '01-Jul-1998'    [  1.2346e+003]
    '02-Jul-1998'    [  2.3456e+003]
0
Reply donn.shull.no_spam (336) 2/11/2010 6:36:05 PM

4 Replies
31 Views

(page loaded in 0.455 seconds)

Similiar Articles:













7/16/2012 1:26:20 PM


Reply: