Calculate ScaleVlues of IIR Filter manually from sosMatrix of MATLAB

while using "design" in matlab to design filters, at the output we can see a ScaleValues matrix that is used to compensate for overflow problem. my question is that how this matrix is calculated? I want to manually calculate it using sosMatrix and p-norms if needed.

thanks a lot.