Method for exporting large set of thickness dimensions, useable by Matlab

I have a part in SolidWorks that has a flat bottom (xy plane) and a continuously varying thickness in the z direction.  I want to find the thickness at each (x,y) point on the part in small x, y intervals and then put the thickness for each x,y point into a matrix to be used in Matlab.  In other words, I am trying to find a way to automatically/efficiently take thickness measurements and map them to the x,y position from some origin on the part, and then put these dimensions into a format that can be interpreted by Matlab.  If anyone has suggestions on how to accomplish this I would greatly appreciate the help!

Thank you.

SolidworksImport export