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
belongs to book: MATLAB: A Practical Introduction to Programming and Problem Solving|Stormy Attaway|Fourth Edition| Chapter number:9| Question number:3.9
All Answers
total answers (1)
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