20.07.2013 Views

Software matematic

Software matematic

Software matematic

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.

3.3. Valori s¸i vectori proprii în MATLAB 95<br />

Sursa MATLAB 3.1 Exemplu de aproximare în sensul celor mai mici pătrate<br />

%CENSUS - exemplu cu recensamantul<br />

% potrivire polinomiala<br />

%datele<br />

y = [ 75.995 91.972 105.711 123.203 131.669 150.697 ...<br />

179.323 203.212 226.505 249.633 281.422]’;<br />

t = (1900:10:2000)’; % anii de recensamant<br />

x = (1890:1:2019)’; % anii de evaluare<br />

w = 2010; % anul de predictie<br />

s=(t-1950)/50;<br />

xs=(x-1950)/50;<br />

cs=polyfit(s,y,3);<br />

zs=polyval(cs,xs);<br />

est=polyval(cs,(2010-1950)/50);<br />

plot(t,y,’o’,x,zs,’-’,w,est,’*’)<br />

text(1990,est,num2str(est))<br />

title(’Populatia SUA’, ’FontSize’, 14)<br />

xlabel(’anul’, ’FontSize’, 12)<br />

ylabel(’milioane’, ’FontSize’, 12)<br />

Milioane<br />

350<br />

300<br />

250<br />

200<br />

150<br />

100<br />

Populatia SUA<br />

312.6914<br />

50<br />

1880 1900 1920 1940 1960 1980 2000 2020<br />

anul<br />

Figura 3.2: Ilustrarea exemplului cu recensământul

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

Saved successfully!

Ooh no, something went wrong!