Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. t = 1:1:(500+2);
  2. t = t'; % Create the time vector for x-axis.
  3. g = t;
  4. g(2:502) = 1.1; % Specify the path of government expenditure.
  5. T = 500; % Spedcify the x-axis length.
  6.  
  7. subplot(2,2,1)
  8. plot(t(1:500), g(1:500), 'r-')
  9. grid on; grid minor;
  10. axis([0 T 0.9 1.2])
  11. g_title = title('Government intervention vs. time');
  12. g_xlabel = xlabel('Time Period');
  13. g_ylabel = ylabel('Shock (from government), g');
  14. g_title.FontName = 'Segoe UI Semibold';
  15. g_title.FontSize = 12;
  16. g_title.FontWeight = 'bold';
  17. g_xlabel.FontName = 'Segoe UI Semibold';
  18. g_xlabel.FontSize = 11;
  19. g_xlabel.FontWeight = 'bold';
  20. g_ylabel.FontName = 'Segoe UI Semibold';
  21. g_ylabel.FontSize = 11;
  22. g_ylabel.FontWeight = 'bold';
  23.  
  24. subplot(2,2,2)
  25. plot(t, k, 'r')
  26. grid on; grid minor;
  27. axis([0 T 37.5 39])
  28. k_title = title('Capital vs. time');
  29. k_xlabel = xlabel('Time Period');
  30. k_ylabel = ylabel('Capital, k');
  31. k_title.FontName = 'Segoe UI Semibold';
  32. k_title.FontSize = 12;
  33. k_title.FontWeight = 'bold';
  34. k_xlabel.FontName = 'Segoe UI Semibold';
  35. k_xlabel.FontSize = 11;
  36. k_xlabel.FontWeight = 'bold';
  37. k_ylabel.FontName = 'Segoe UI Semibold';
  38. k_ylabel.FontSize = 11;
  39. k_ylabel.FontWeight = 'bold';
  40.  
  41. subplot(2,2,3)
  42. plot(t(1:500), c(1:500), 'r-')
  43. axis([0 T 1.62 1.8])
  44. grid on; grid minor;
  45. c_title = title('Consumption vs. time');
  46. c_xlabel = xlabel('Time Period');
  47. c_ylabel = ylabel('Consumption, c');
  48. c_title.FontName = 'Segoe UI Semibold';
  49. c_title.FontSize = 12;
  50. c_title.FontWeight = 'bold';
  51. c_xlabel.FontName = 'Segoe UI Semibold';
  52. c_xlabel.FontSize = 11;
  53. c_xlabel.FontWeight = 'bold';
  54. c_ylabel.FontName = 'Segoe UI Semibold';
  55. c_ylabel.FontSize = 11;
  56. c_ylabel.FontWeight = 'bold';
  57.  
  58. subplot(2,2,4)
  59. plot(t, y, 'r')
  60. axis([0 T 3.7 3.74])
  61. y_title = title('Production vs. time');
  62. y_xlabel = xlabel('Time Period');
  63. y_ylabel = ylabel('Production, y');
  64. grid on; grid minor;
  65. y_title.FontName = 'Segoe UI Semibold';
  66. y_title.FontSize = 12;
  67. y_title.FontWeight = 'bold';
  68. y_xlabel.FontName = 'Segoe UI Semibold';
  69. y_xlabel.FontSize = 11;
  70. y_xlabel.FontWeight = 'bold';
  71. y_ylabel.FontName = 'Segoe UI Semibold';
  72. y_ylabel.FontSize = 11;
  73. y_ylabel.FontWeight = 'bold';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement