Q:

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:

0

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:

2004 2005 2006 2007 2008 2009 2010 2011

72 74 74 77 80 83 89 93

250 270 300 310 350 390 410 380

Create a file in this format, and then load the information into a 

matrix. Create a horizontal stacked bar chart to display the 

information, with an appropriate title. Note: use the ‘XData’ property 

to put the years on the axis as shown in Figure 11.35.

Figure 12.33 Horizontal stacked bar chart of median incomes and home prices

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Ch12Ex17.m

% Read in median incomes and house prices from a file

% and plot using a stacked bar

load houseafford.dat

h = barh(houseafford(2:3,:)','stacked');

xlabel('$')

ylabel('Year')

set(h,'Xdata',houseafford(1,:))

title('Median Income and Home Prices')

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now