This works for today’s plots (I tested it on all of them):
openfig('Figure(7).fig');
h1c = get(gca, 'Children');
Xdc = get(h1c, 'XData');
Ydc = get(h1c, 'YData');
maxlen = max(cell2mat(cellfun(@max, cellfun(@size, Xdc, 'Uni',0),'Uni',0)))
Xd2 = cell2mat(Xdc(2));
Yd2 = cell2mat(Ydc(2));
Xd = Xd2;
Yd1 = cell2mat(Ydc(1));
Yd = [Yd1(1)*ones(size(Xd2)); Yd2];
Ydn = diff(Yd, [], 1);
Zx = circshift(Ydn, [0 1]) .* Ydn;
Zxi = find(Zx < 0);
for k1 = 1:length(Zxi)
Xzx(k1) = interp1([Ydn(Zxi(k1)-1) Ydn(Zxi(k1))], [Xd(1,Zxi(k1)-1) Xd(1,Zxi(k1))], 0);
end
hold on
plot(Xzx, repmat(Yd(1,1),1,length(Xzx)), '*r')
hold off
Best Answer