You are working with quite a large variable. I have tried the following
When running whos it says that the variable n uses a bit more than 11 GB of memory. That is more than what most of the normal computers/laptops have :) I think that your computer simply does not have enough memory (RAM). How much RAM does your computer have?
There are some things that you can try.
1) Before converting to cell arrays, you can try to convert the variable from double to single:
This will make the variable n use half of the memory it did when it was a double.
2) Normally, MATLAB limits the maximum array size to a percentage of the RAM of the computer. You can get rid of this limit by this path:
Click the Home tab --> Click Preferences --> Choose Workspace in the left menu --> On the bottom of the page there is a box saying "Limit the maximum array size to a percentage of RAM". Make sure that this box is empty --> Click Apply and OK.
I suggest that you start with step 2. If that does not work, supply with step 1.
If none of the above works, you can make MATLAB use virtual memory. You can read more about it here:
The tradeoff of using virtual memory is the computation speed!