SegmentDistance[x1_,y1_,x2_,y2_] := Sqrt[(y2-y1)^2+(x2-x1)^2]

Numpoints = 50;
Numpaths = 5;

xMin=0;

xMax=1;

x = Table[(xMax-xMin)*j/(Numpoints+1),{j,0,Numpoints+1}]

x[[0]]

y = Table[If[j==0,0,If[j==Numpoints+1,1,x[[j+1]]+RandomReal[{-0.3,0.3}]]],{i,1,Numpaths},{j,0,Numpoints+1}];

y[[1]]

y[[1]][[2]]

f = Table[{x[[j+1]],y[[i]][[j+1]]},{i,1,Numpaths},{j,0,Numpoints+1}];

fInt = Table[Interpolation[f[[i]],InterpolationOrder->1],{i,1,Numpaths}]

fInt[[1]][x]

fInt

Plot[Table[fInt[[i]][x],{i,1,5}],{x,0,1}]

SegmentDistance[0,0,l,h]