Michel,
I have 12 pound lines at the top of a model section, and 70 variables/equations. The _static.m file initializes g1 matrix as 70x70, but starts writing at only 13th line, and references 82nd line. This produces a Matlab error.
It seems, that the number of pound lines is not subtracted from an equation index when writing g1 matrix. Forming residual is correct.
thanks for considering this bug report
best
Ondra K.