Geoscience Reference
In-Depth Information
clear
data = load('sherwoodsandstone.txt');
h e i ve columns of the array
data
contain the numerical values of the
petrophysical parameters permeability (in m/s), porosity (without physical
unit), matrix conductivity (in S/m), true formation factor (without physical
unit), and induced polarization (in %). We also load the sample IDs (from
Olorunfemi 1985) from the i le
sherwoodsandstone_samples.txt
using
textscan
:
fid = fopen('sherwoodsandstone_samples.txt');
samples = textscan(fid,'%s','Headerlines',8);
fclose(fid);
h e
sherwoodsandstone_samples.txt
i le contains 40 sample IDs, each with
i ve characters including spaces that are used to make the length of the
sample IDs identical so that they i t into the cell array
samples
. h is cell
array contains only one cell,
samples{1}
, which in turn contains a 40-by-5
character array of the sample IDs. We next create another character array
that contains the variable names:
Perm
for permeability,
Poro
for porosity,
MaCo
for matrix conductivity,
TrFF
for true formation factor, and
InPo
for induced
polarization.
variables = ['Perm';
'Poro';
'MaCo';
'TrFF';
'InPo'];
We then display the variables in a plot that includes a legend and has the
data points labeled with the sample IDs. We use random colors for the data
points, with the random number generator i rst set to a seed value of 0. Since
the values of the variables are very small we plot the logarithm of the values
instead of the true values.
rng(0)
for i = 1:size(data,2)
rcolor = rand(1,3);
line(log(data(:,i)),1:40,...
'Marker','Square','MarkerEdgeColor',rcolor,...
'MarkerSize',8,'MarkerFaceColor',rcolor,...
'LineStyle',':','Color',rcolor)
text(log(data(:,i))+0.1,1:40,samples{1})
end
legend(variables)
We then calculate the coei cients
beta
of the multiple linear regression