Function to create a regressionplot()
3 次查看(过去 30 天)
显示 更早的评论
Good morning everybody,
I'm struggling at realizing a portion of code which allows me to automatically extrapolate the set of data to compose the object for the regressionplot() function, which requires a Tx2 matrix.
So let's make an example of my matrix with elements which indicate only the date of the "regression" event (montlhy data):
[31/05/2000
02/06/2001
03/06/2001
05/06/2002
06/06/2002
07/06/2002 ]
and the result which I want to obtain to use in the recessionplot() should be:
[31/05/2000 01/06/2000
02/06/2001 04/06/2001
05/06/2001 08/06/2001]
In order ot allow the presence of recession shadow also for just one month data, I need to set the closing month as i+1 (thus it is 01/06 instead of only 31/05)
How could I obtain such a Tx2 matrix?
Thank you in advance!
2 个评论
KSSV
2020-9-8
I hope for the dates you have respective values. Convert the dates into datenum. USe interp1 with the available data and with new date.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Time Series Objects 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!