% Convert Sw vs Pc data into format for gaussf
clear all
clf reset
[fid, message]=fopen('lime.dat','r');
load lime.dat;
status=fclose(fid);
Sw=lime(:,1);
Pc=lime(:,2);
% P is cumulative probability, y = mu + sig u
% Sinf is the extrapolated nonwetting phase at infinite Pc
Sinf=input('Nonwetting Sinf = ? ');
P=(1-Sw)/Sinf;
y=log(Pc);
gaussd=[y P];
[fid, message]=fopen('gaussd.dat','w');
save gaussd.dat gaussd -ascii
status=fclose(fid);
