so I was trying to reach the Arduino SD card directly from Matlab itself.

You can't reach an SD Card on an Arduino directly from Matlab. You need to get Matlab to send data to an Arduino program and then the Arduino program will write the data on the SD Card.

I had assumed from my very first reply that you understood that.

And I come back, yet again, to the error message in your Original Reply in which it appears that Matlab could not find the COM port that your Arduino is connected to. At no stage since then have you said that that problem was solved or that it was no longer relevant.

If Matlab has a problem finding the COM port that your Arduino is connected to that seems to me to be a Matlab problem. I assume you have no difficulty connecting to the Arduino using the Arduino IDE.

...R