Hi Wenjie,
Line 97: ConfTargetAll = ConfidenceAll(:,outputNN_ind);
My env is R2018a...After execute this code, variant "ConfTargetAll" is a fix value, not 1*n values.
So I think this is not the correct way to specify a row or column and take corresponding probability. It seems that this line of code only takes the value from the "outputNN_ind" index.
As same as your "ubber boundary" part.