Skip to content
Snippets Groups Projects
Commit 1df58237 authored by leprob001's avatar leprob001
Browse files

Updated matrix calculations.

parent 10169d25
No related branches found
No related tags found
No related merge requests found
141
\ No newline at end of file
142
\ No newline at end of file
......@@ -6,7 +6,8 @@ global artoaGui artoaWorkspace;
newValue = artoaGui.editOffsets.inputSoundspeed.String;
artoaWorkspace.editOffsets.fixedSoundspeed = str2double(newValue);
% required in km/s
artoaWorkspace.editOffsets.fixedSoundspeed = str2double(newValue) / 1000;
end
......
......@@ -24,7 +24,8 @@ varNames = X.Properties.RowNames;
for i = 1:length(varNames)
% check if it is soundspeed
if strcmp(varNames{i}, 'Soundspeed')
artoaWorkspace.editOffsets.optimumSoundspeed = X{varNames{i}, 'Value'};
% [km/s] * 1000
artoaWorkspace.editOffsets.optimumSoundspeed = X{varNames{i}, 'Value'} * 1000;
continue;
end
% check if it is offset
......
......@@ -43,14 +43,17 @@ if pOffsetsParameter.useFixedSoundspeed
return; % nothing to be done, everything is given and soundspeed is fixed
end
B.toa = B.toa - A{:, 'Distances'} * pOffsetsParameter.fixedSoundspeed;
B.toa = B.toa - A{:, 'Distances'} * (pOffsetsParameter.fixedSoundspeed / 1000);
A.Distances = [];
end
%% Solve it!
X = pinv(A{:, :}) * B.toa;
X = B.toa \ A{:, :};
%% Apply row names to X
if isrow(X)
X = X';
end
X = table(X, 'VariableNames', {'Value'}, 'RowNames', A.Properties.VariableNames);
% Rename Distance column to Soundspeed
varNames = X.Properties.RowNames;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment