Issues with recessionplot command

3 ビュー (過去 30 日間)
Hussain Hadah
Hussain Hadah 2019 年 9 月 7 日
コメント済み: Sudip 2022 年 11 月 5 日
Hello all,
I am trying to use the recessionplot to shade recessions on my plot. My date series is just the years from 1970 to 2018. Do I need to convert the dates even though they are just numbers to use the recessionplot?
Here is the code I am using:
clear; clc
load('GrowthAccountingVectors.mat')
plot(Year,normalAtothepower)
recessionplot
hold on
plot(Year,normalKoverYtothepower)
plot(Year,normalLoverN)
plot(Year,normalYoverN)
hold off
legend("A ^ (1/(1-alpha))", "(K/Y) ^ (alpha/(1-alpha))","L/N","Y/N")
xlabel("Year")
ylabel("Normalized Values")
title("Growth Accounting for Spain")
grid on
Thank you in advance!
  1 件のコメント
Sudip
Sudip 2022 年 11 月 5 日
have you solved it? the recessionplot command does not work for me

サインインしてコメントする。

回答 (1 件)

Payas Bahade
Payas Bahade 2019 年 9 月 18 日
Hi Hussain,
For overlaying recession bands on plot using ‘recesssionplot’, date information needs to be converted to serial date numbers. Date information can be converted to serial date numbers by using ‘datenum’.
Below mentioned link would help you understand how to convert dates using ‘datenum’:

カテゴリ

Help Center および File ExchangeData Preprocessing についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by