Skip to content
Snippets Groups Projects
Commit 55f9ab89 authored by leprob001's avatar leprob001
Browse files

Added a more descriptive error message if variation calculation is failing.

parent 21e4f580
No related branches found
No related tags found
No related merge requests found
305
\ No newline at end of file
306
\ No newline at end of file
......@@ -48,6 +48,10 @@ for i = 1:length(variationResults{end}.dates)
results{i}.observations = observations;
% get covariance matrix
results{i}.covarianceMatrix = cov(observations);
% check if matrix contains nan or inf
if (any(isnan(results{i}.covarianceMatrix), 'all') | any(isinf(results{i}.covarianceMatrix), 'all'))
error([mfilename ': Covariance matrix contains NaN or Inf, the eigenvalues cannot be calculated. This could be a result of a not converging tracking algorithm.']);
end
% eigendecomposition
[results{i}.V, results{i}.D] = eig(results{i}.covarianceMatrix);
end
......
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