Having a problem with adding a matrix

I am using ESP32, and it's not a memory issue because I managed to run the code on two matrices with the same array. I want to create a situation where each matrix will have its own array.
I use only 5 percent of the memory