%Example2_13.m  line source problem. Weighted Least Squares
clear all
format short g
t=[0.7916; 1.2916; 2.0833; 3.4582; 5.7081; 9.2913; 15.1660; 24.7490; 40.3320 ]
y =[65.2010; 66.2620; 67.3580; 68.5790; 69.8210; 71.0220; 72.0390; 73.2130; 74.3840 ]
figure(1); clf; plot(log(t),y,'b-o', 'linewidth', 1 );
xlabel('Ln(time)');
ylabel('Temperature, F')
C =[0.0200; 0.0200; 0.0200; 0.0200; 0.0200; 0.0200; 0.0800; 0.0800; 0.0800 ]
X=[ones(9,1) (0.25*36.3/pi)*log(t)];
Cr=C.*C;
V=diag(Cr');
b=lscov(X,y,V)
% print the 600 dpi figure to tiff format
fig=figure(1);
print(fig,fullfile(pwd, 'Figure2_6.tif'),'-dtiff','-r600')
