% analyzeGrid.m

%% analysis using interpolation of analysis grid
% Measurement
M1 = 0.65 % measurement #1 before adding absorber dmua
M2 = 0.40 % measurement #2 before adding absorber dmua
plot(M1,M2,'ko','markersize',14,'linewidth',2)

% analysis by interpolation
F1 = TriScatteredInterp(RR1,RR2,ma);
F2 = TriScatteredInterp(RR1,RR2,ms);
pmua  = F1(M1,M2);
pmusp = F2(M1,M2);

% add to figure 1
figure(1)
x = 0.05;
text(x,0.8,['R_{sample} = ' sprintf('%0.2f',M1)],'fontsize',14)
text(x,0.7,['R_{sample+\Delta\mu_a} = ' sprintf('%0.2f',M2)],'fontsize',14)
plot([0.40 M1], [0.55 M2],'k-','linewidth',2)
text(x,0.6,'the measurement indicates ','fontsize',14)
text(x,0.5,['\mu_a = ', sprintf('%0.2f cm^{-1}',pmua)],'fontsize',14)
text(x,0.4,['\mu_s'' = ', sprintf('%0.2f cm^{-1}',pmusp)],'fontsize',14)

% check:
pM1 = getRd(pmua,pmusp)
pM2 = getRd(pmua+dmua,pmusp)
plot(pM1,pM2,'k+','markersize',14,'linewidth',2)
