A file houseafford.dat stores on its three lines years, median incomes and median home prices for a city. The dollar amounts are in thousands. For example, it might look like this:
2000 2001 2002 2003 2004 2005 2006 2007 72 74 74 77 80 83 89 93 250 270 300 310 350 390 410 380
Load the information into a matrix from a file called ‘houseafford.dat'. Create a figure with two subplots as shown below:
The left plot is a horizontal stacked bar chart to display the information shown as follows, with an appropriate title. Note: Look up the document for the bar function and use the ‘stacked' option; May set the ‘XData' property to put the years on the axis as shown in the figure.
The right plot shows the ratio of the home price to the income is called the housing affordability index. Calculate this for every year and plot it as in the figure. The x-axis should show the years (e.g., 2000-2007) as the figure below.
Get the handle to figure and change its window size to 900x400. Save your script in a .m file called ‘yourname_lab6_1.m".