Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Question 2.
- A. population.m
- function [pop] = population(t)
- pop = 197273000./(1+exp(-0.0313.*(t-1913.25)));
- B.
- >> population(2050)
- ans =
- 1.9458e+008
- C.
- >> PopApprox = population(2010);
- >> PopExact = 281421906;
- >> PercentDifference = (PopExact - PopApprox) / ((PopExact + PopApprox)/2) * 100;
- >> PercentDifference
- PercentDifference =
- 39.7182
- D.
- >> years = linspace(1790,2010,(2010-1790)*2);
- >> popCurve = population(years);
- >> plot(years,popCurve);
- E.
- >> title('George Hahn - G00207171');
- >> xlabel('Year');
- >> ylabel('Approximate United States Population');
- Question 3.
- A.
- >> n = [5:5:100];
- >> ApproxE = (1 + 1./(n)).^n;
- B.
- >> ApproxE(1,50/5) //Because we are counting by 5's
- ans =
- 2.6916
- C.
- >> PercentError = (ApproxE - exp(1))/exp(1)*100;
- D.
- >> plot(n,PercentError)
- >> title('George Hahn - G00207171');
Add Comment
Please, Sign In to add comment