%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Till föreläsning 9
%
% Indata: Flaskans höjd över marken som funktion av tiden
% Utdata: Tidpunkt för 3m-passage.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

t=2:(-0.2):0;
h=[12.5 12.4 12.0 11.3 10.5 9.3 7.9 6.2 4.3 2.1 0];

%plot(x,y,'o'); % Jag tittade hur indata ser ut. Linjär approx nog OK?


t3o=q2(t,h);           % ostört värde

tt=t3o;

for i=1:length(h);     % För alla h-värden...
  hs=h;
  hs(i)=hs(i)+0.05;
  ts=flasktid(t,hs);   % beräknas t3
  tt=[tt, ts];         % och lagras.
end;

e=sum(abs(tt-t3o))     % Ber störningen i t3 i varje och summera

%%%%%%%%%%%%%%%%%%%%% Dagbok %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% >> flaska
%
% e =    0.0046
%
% >> tt
%
% tt =
%
%  Columns 1 through 7 
%
%    1.7182    1.7182    1.7182    1.7182    1.7182    1.7182    1.7182
%
%  Columns 8 through 12 
%
%    1.7182    1.7182    1.7200    1.7209    1.7182
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

