Skip to main content

calcTrackingSynergyVectorsDiscrete.m


% This function is part of the NMSM Pipeline, see file for full license.
%
% This function calculates the difference between the original and current
% synergy weights.
%
% (2D matix, struct, struct) -> (Array of number)
%


function cost = calcTrackingSynergyVectorsDiscrete(synergyWeights, ...
params, costTerm)

origSynergyWeights = getSynergyWeightsFromGroups(...
params.synergyWeightsGuess, params);
origSynergyWeights(origSynergyWeights==0) = [];
synergyWeights(synergyWeights==0) = [];
cost = calcTrackingCostArrayTerm(synergyWeights, ...
origSynergyWeights, 1:size(synergyWeights, 2));
cost = cost(:) / costTerm.maxAllowableError;
end