Q:

A spreadsheet popdata.xlsx stores the population every 20 years for a small town that underwent a boom and then decline. Create this spreadsheet (include the header row) and then read the headers into a cell array and the numbers into a matrix

0

 A spreadsheet popdata.xlsx stores the population every 20 years for

a small town that underwent a boom and then decline. Create this 

spreadsheet (include the header row) and then read the headers into a

cell array and the numbers into a matrix. Plot the data using the 

header strings on the axis labels.

Populatio

 Year          n

1920        4021

1940        8053

1960       14994

1980        9942

2000       3385

All Answers

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

Ch9Ex3.m

% Read population data from a spreadsheet

% and plot it

%Read numbers and text into separate variables

[num, txt] = xlsread('popdata.xlsx'); 

%Create vectors for the plot

year = num(:,1);

pop = num(:,2);

plot(year,pop','ko')

%Axes labels based on header strings

xlabel(txt{1})

ylabel(txt{2})

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