The code is as such:
Code
int Round = 1;	
var CurrentSD = 100;
var ProposedSD = 100;

do
{
   CurrentSD = ProposedSD;
   printf("#\n///// Round: %i //////", Round);
   ProposedSD = GetNewestSD(CurrentSD);
   Round++;
} while (CurrentSD > ProposedSD);

var GetNewestSD(var currentSD)
{
   var NewSD = currentSD;
   int i;
   for(i = 0; i < N; i++)
   {	
      mat TrackingErrorMatrix = matrix(N,1);
      mat TransposeTrackingErrorMatrix = matTrans(matrix(TrackingErrorMatrix->cols,TrackingErrorMatrix->rows), TrackingErrorMatrix); 
   }

   if (Round == 20) return NewSD;
   else return NewSD/2;
}


Basically, the script will loop through the function 20 times before it stops. However, every time at loop 18th, the same error will occur:

Code
//////// Round: 1 //////////

//////// Round: 2 //////////

...


//////// Round: 17 //////////

//////// Round: 18 //////////
Error 041: Too many matrices!
Error 111: Crash in run: GetNewestSD()


Last edited by vicknick; 01/08/25 12:44.