12.07.2015 Views

Basics of MATLAB and Beyond

Basics of MATLAB and Beyond

Basics of MATLAB and Beyond

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

load population.datyear = population(:,1);P = population(:,2);plot(year,P,’:o’)box;gridThe European population prior to 1850 was very low <strong>and</strong> we are unableto see the fine detail. Detail is revealed when we use a logarithmic y-scale:semilogy(year,P,’:o’)box;gridThe following functions implement logarithmic axes:loglogsemilogxsemilogyBoth axes logarithmiclogarithmic x-axislogarithmic y-axis14 Curve Fitting—Matrix DivisionWe continue with the example <strong>of</strong> Australian population data given inthe previous section. Let us see how well a polynomial fits this data. Weassume the data can be modelled by a parabola:p = c 0 + c 1 x + c 2 x 2where x is the year, c 0 , c 1 , <strong>and</strong> c 2 are coefficients to be found, <strong>and</strong> p isthe population. We write down this equation substituting our measureddata:p 1 = c 0 + c 1 x 1 + c 2 x 2 1p 2 = c 0 + c 1 x 2 + c 2 x 2 2.p N = c 0 + c 1 x N + c 2 x 2 Nc○ 2000 by CRC Press LLC

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!