1st - "viborka" (for russian "selection") looking for 4 in series nearest same-Z points (if it possible)
2d - inter (interpolation) interpolate these 4points in new coordinate system, built on first and last point of 4.
3d - izolin and vse makes a table
unzip file in current dir.
load your X,Y,Z
Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.