A first attempt of mine would be
wave_coordinates = bwboundaries(BW);
xy = cell2mat(wave_coordinates);
%create array with y values
waveY = xy(:,1);
%create array with y values
waveX = xy(:,2);
%find edge points (where x is min and max)
[edge1 idx1] = min(waveX)
[edge2 idx2] = max(waveX)
%find all points that are above the right edge point
idx_upperLine = waveY >= waveY(idx1);
%create array with x and y coordinates of all point above the edge point (which is hopefully the upper Line)
surfaceX = nonzeros(waveX(idx_upperLine));
surfaceY = nonzeros(waveY(idx_upperLine));