MATLAB: I have 2 values of population say 30000 for 2001 and 50000 for 2011, I want the population values for all the years between 2001 to 2011 following the trend of population rise from 2001 to 2011

extrapolationMATLAB

do I use the extrapolation technique for this? If so how?

Best Answer

Dear Sourangsu,Using interplotation you can do like this:
Known_year = [2001 2011];
Known_year_population = [30000 50000];
Unknown_year = 2002:2010;
Unknown_year_population = interp1(Known_year, Known_year_population, Unknown_year);
year = 2001:2011;
population = [30000 Unknown_year_population(:,:) 50000];
plot(year, population, 'o-'), title('Population vs. Year'), xlabel('Year'), ylabel('Population')
Good luck!