function parametri=model(pod,perioda) %parametri=model(pod,perioda) %izracuna parmetre modelne funkcije (glej funkcijo 'modelnafunkcija.m') %za kolicino co2 iz podatkov podani %v matriki 'pod' (prvi stolpec je cas, drugi meritve) %po metodi najmanjsih kvadratov z resitvijo normalnega sistema. %'perioda' je dodatni parameter v modelni funkciji, ki naj bi predstavljal %periodo soncnih peg.\\ %Computes the parameters for the model function (see 'modelnafunkcija.m') %for the cocsentration of co2 from the data in %the matrix 'pod' (the first column contains time, the second the %measurements). %'perioda' is an additional parameter which represents the period of the %sunspot cycle. t=pod(:,1)-1979;%odstejemo zacetni cas, da bo racunanje bolj numericno stabilno / for numrical %stability we substract 1979 from the time paramater n=length(t);%stevilo podatkov / number of measurements A=[ones(n,1) t cos(2*pi*t) sin(2*pi*t) cos(4*pi*t) sin(4*pi*t) cos(2*pi*t/perioda) sin(2*pi*t/perioda) t.^2];%matrika sistema / matrix system y=pod(:,2);%desna stran sistema / right-hand side of the system N=A'*A;%normalni sistem / normal system b=A'*y; parametri=N\b;%resimo normalni sistem / solving the normal system