Reading 2D Arrays into a Microcontroller
I suggest to put the complexity on the PC side and not on the microcontroller side. 

You should store the file on the sd card as a binary image of the memory content you would like to get on the microcontroller. Storing in a defined binary format should be doable directly from Matlab.

All you have to do is to copy byte after byte the content of you sd card in a predefined area in the SRAM.

An even simpler form would be to avoid using a file system at all and use the SD card as a raw medium. Event easier at the microcontroller side...

Having the complexity at the PC side makes this much easier:


You can use whatever programming language you want and you are not restricted to what is available on the MCU. I would use Python for this but that's a personal preference.
It's easy to debug PC software in comparison to MCU one.
Your MCU would have less things to do and thus more available computational time to do something else (or go to sleep to save batteries)