When you do not specify a reference ellipsoid, the distance function computes the distance between two points on the sphere and returns the answer as an arclength in degrees (angular units).
arclen_check1 = distance('rh',startLat,startLon,latC,lonC);
When you specify a reference ellipsoid, it doesn't make sense to return the answer in angular units. Instead, it returns the distance using the same units as the reference ellipsoid itself.
e = wgs84Ellipsoid
e.LengthUnit
This can be verified by using the deg2km function:
arclen_check2 = distance('rh',startLat,startLon,latC,lonC,e);
arclen1InMeters = deg2km(arclen_check1) * 1000;
Best Answer