Skip to content

Commit

Permalink
Real fix - get unit types if saving failed
Browse files Browse the repository at this point in the history
  • Loading branch information
Julie-Fabre authored Oct 13, 2023
1 parent 3422d12 commit 3085c87
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions qualityMetrics/bc_getQualityUnitType.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
% ------
% Outputs
% ------
if ~isfield('fractionRPVs_estimatedTauR', qMetric)
qMetric.fractionRPVs_estimatedTauR = arrayfun(@(x) qMetric.fractionRPVs(x, qMetric.RPV_tauR_estimate(x)), 1:size(qMetric.fractionRPVs,1));
qMetric = rmfield(qMetric, 'fractionRPVs');
if istruct(qMetric) % if saving failed, qMetric is a structure and the fractionRPVs_estimatedTauR field we need below is not computed yet
if ~isfield('fractionRPVs_estimatedTauR', qMetric)
qMetric.fractionRPVs_estimatedTauR = arrayfun(@(x) qMetric.fractionRPVs(x, qMetric.RPV_tauR_estimate(x)), 1:size(qMetric.fractionRPVs,1));
qMetric = rmfield(qMetric, 'fractionRPVs');
end
end


Expand Down

0 comments on commit 3085c87

Please sign in to comment.