Iassume youare trying to calculate theGeodesicdistance from theEuclideandistance and the code you have posted iscalculating theEuclideandistance. In the following code instead of using ‘csvread’ it isrecommendedto use ‘readmatrix’ commands on the newer versions of MATLABafter2019a.For calculationofthe Geodesic distance you canusethemethod‘bwdistgeodesic’forthematrixD1.
D= bwdistgeodesic(D1,C,R)
This willcomputethe geodesic distance transformfrom the matrix.
For moreinformation for calculation Geodesic distance you can go through these documentationlinks:
Best Answer