function narisi(pod,perioda) %narisi(pod,perioda) %narise podatke o koncentraciji co2 podani v matriki 'pod' %(prvi stolpec je cas, drugi stolpec so meritve) %skupaj z modelno funkcijo, za katero paramtetre dolocimo po metodi %najmanjsih kvadratov. %Narise se graf napake in izracuna in izpise vsoto kvadratov napake modela. % / plots the graph of co2 given in the matrix 'pod' %together with the model function that approximates the data t=pod(:,1);%cas / time x=pod(:,2);%meritve / measurements par=model(pod,perioda)%izracuna paramatre modela / computes the model parameters mx=modelnafunkcija(par,t,perioda);%izracuna vrednosti modelne funkcije %ob danih casih / computes model function values figure(1);%prvi graf / first figure clf; hold on plot(t,x,'r');%narisemo podatke / plots data plot(t,mx,'b');%narisemo vrednosti modelne funkcije / plots model function figure(2);%drugi graf / second figure clf; plot(t,x-mx);%graf napake / error graph err=(x-mx)'*(x-mx)%izracun vsote kvadratov napake / sum of squares of errors