Why is this Julia code considerably slower than Matlab

Thanks for the info about how to get memory usage data from the Matlab profiler! Apparently this is an undocumented feature of Matlab. I just played with it a bit and seemed to get inconsistent results, so perhaps it’s unreliable. Or perhaps I’m using it incorrectly. Hard to say, since it’s undocumented…