Bug Description
In DecodingAlgorithms.m lines 496-501 and 664-665, when there are multiple cells (C > 1) but only a single gamma vector, the code reuses the loop variable c from an already-terminated for c=1:C loop:
Since c retains its final value C after the loop exits, gammaNew(:,c) only writes to the LAST column, leaving all other columns as zeros. This affects multi-cell decoding with shared gamma parameters.
Expected Fix
gammaNew = repmat(gamma, 1, C);
Found during comprehensive cross-toolbox audit. Python nSTAT-python handles this correctly via np.repeat in _normalize_gamma().
Bug Description
In
DecodingAlgorithms.mlines 496-501 and 664-665, when there are multiple cells (C > 1) but only a single gamma vector, the code reuses the loop variablecfrom an already-terminatedfor c=1:Cloop:Since
cretains its final valueCafter the loop exits,gammaNew(:,c)only writes to the LAST column, leaving all other columns as zeros. This affects multi-cell decoding with shared gamma parameters.Expected Fix
Found during comprehensive cross-toolbox audit. Python nSTAT-python handles this correctly via
np.repeatin_normalize_gamma().