Function to create a regressionplot()
조회 수: 4 (최근 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!