In old matlab versions, I could extract x and y points along a contour line as shown below. This is incredibly useful in my work. Now in R2015 the approach doesn't work (hh.XData and hh.YData are the x and y values of the data you're contouring, rather than the x,y position of the contour line). In more recent versions of contour, how can I extract x,y points along a contour line? If I can't do it via contour, is there another way?
z = peaks;
x = 1:size(peaks, 2); y = 1:size(peaks, 1);
figure;
pcolor(x, y, z);
shading flat;
hold on;
[cc, hh] = contour('v6', x, y, z, [0 10^5], 'k');
xPointsOfContour = get(hh(1), 'xdata');
yPointsOfContour = get(hh(1), 'ydata');
plot(xPointsOfContour, yPointsOfContour, 'w.');