Logical indexing for a financial time series

조회 수: 1 (최근 30일)
T.D.
T.D. 2012년 10월 19일
I can't be asking much.. I want to be able to logically index a time series function and I cannot seem to do it without extracting the data matrix.
Here's an example:
data = (1:10)';
dates = busdays(today-11, today);
Generate time series
ts = fints(dates, data);
I want to find the date where my ts value is 4
find(ts == 4)
But I get:
ans =
[]
Now if I do the following, I get the result I am after.
datestr(ts.dates(fts2mat(ts) == 4))
ans =
11-Oct-2012
Is there a way of logically indexing a financial time series object directly?

답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by