Since you're interested in the values of the empirical CDF curves, you could use the ecdf function as opposed to cdfplot. The ecdf function will return the (x,y) vectors of the empirical CDF fit which you can then use to compute your Kolmogorov-Smirnov distance. You can find out more about the ecdf function in the documentation:
On another note, you may need to perform some sort of interpolation to "expand" the data vectors from one empirical CDF to match the dimensions of the other. For example, you may have one ecdf with 50 values and another with 25. In this example, you need to interpolate the smaller data set, such that the dimensions are the same. From there, the distance calculations should be pretty straightforward. For interpolation, MATLAB has the handy interp1 function. Here is a link to the interp1 documentation:
Seems like an interesting problem! Good luck!