Я написал код, который поможет вам на полпути! Это читается в оценках параметров из таблицы выше ковариационной матрицы.
function out = GET_parameter_estimates_from_LogFile(FileAddress)
out = cell(0);
%sometimes its a cell
if iscell(FileAddress)
FileAddress=FileAddress{1};
end
%open it!
fid = fopen(FileAddress,'r');
if fid<0 %the file doesnt exist
display(['the file ',FileAddress,' is missing'])
out={};
else %the file exists
TableNumber=0
while ~feof(fid)
%there are multiple tables of parameter values in the file and we want
%parameter values from all of them!
TableNumber=TableNumber+1;
% Find the line the (next) table starts on!
while ~feof(fid)
line = fgetl(fid);
%is the 5 percent and 95 percent enough of a marker to identify the
%header line?
if ~isempty(strfind(line,'PARAMETER NUMBER,')) && ~isempty(strfind(line,'TYPE,'))
break %found a part of the logfile where parameter values are listed
end
end
if exist('line','var')
line(strfind(line,'NUMBER')-1)='_';
else
display('cant find the SDLN table in ', FileAddress,'using Dummy logfile')
end
if length(line)>1 % don't do anything if its the last line of the file which is length 1
header = textscan(line,'%s','delimiter',' ');
header = header{1};
unwanted_elems = zeros(0);
for i=1:length(header)
if isempty(header{i})
unwanted_elems(end+1)=i;
end
end
if ~isempty(unwanted_elems)
header(unwanted_elems)=[];
end
if size(header,1) > size(header,2)
header = header';
end
out(1,:,TableNumber)=header;
k=2;
% get the stuff under the header
while ~feof(fid)
line = fgetl(fid);
%first non-table line is just a single space
if length(line)<=1
break
end
header = textscan(line,'%s','delimiter',' ');
header = header{1};
unwanted_elems = zeros(0);
for i=1:length(header)
if isempty(header{i})
unwanted_elems(end+1)=i;
end
end
if ~isempty(unwanted_elems)
header(unwanted_elems)=[];
end
if size(header,1) > size(header,2)
header = header';
end
out(k,:,TableNumber)=header;
k=k+1;
end
end
end
fclose(fid);
end
%out is the output
end