在matlab中指出时间序列图中的日期

时间:2014-03-24 12:08:14

标签: matlab plot

我有一个时间序列的每日价格,我绘制了它,我有一些日子,我想在这几天的价格曲线上用一个圆圈突出显示。例如,时间序列从1-jun-2000到1-oct-2000,我有5-jun-2000,6-jun-2000,10-aug-2000,...我的价格我希望显示在情节上。问题是,我想指出的一系列日子是在一个不同的向量,我不会在所有日子的系列中找到它们。我想我应该首先在完整的日期系列中找到这些特定日期的索引,然后使用此索引指出要在曲线上突出显示的相应价格。有什么帮助吗?

提前谢谢

约翰

1 个答案:

答案 0 :(得分:0)

没关系,我刚刚得到它:

[tf, index] = ismember(Date, tofindDate) % get the position in series 
plot(Date(index),p(index),'ro') % highlight the desired point