I suggest that you use the Apps store to load in "StatsBar". After it is installed, find it in Applications and launch it. Then, go up to the icon that appears in your toolbar (upper right of screen), and click on there. That will launch it. When you are actively using it to monitor something, I recommend going over to the upper left of the monitor window and click on the "anchor" symbol: once that is done, the monitor window will stay active when you click on another window.
I suggest you monitor memory use as you go. After you have launched MATLAB, click on the "Clean Memory" area of the StatsBar monitor window. When it finishes cleaning, have a look at "Free" (Memory). Then as you run the program, keep your eye on the Free figure. When it starts getting low, click on Clean Memory again. StatsBar will automatically run cleaning for you without you having to click there, but StatsBar tends to leave that a bit late in the cycle, when you are down to only a couple of hundred megabytes, and when you get down that far, cleaning memory takes exponentially longer.