MATLAB: How to pull data from a figure with multiple plots

figure plot data multipleMATLAB

I have a Matlab figure with 3 plots on it and I am trying to pull 'YData' from just one of the plots. I am trying to use the following:
h=findobj(gca,'Type');
y=get(h,'YData');
I do realize that this is only picking the YData from one plot but I do not know the plot naming structure or how to select between plots in one figure to pull data. How can I do this?

Best Answer

Looks strange too me. Do you use R2014b with the new graphic? If on the old graphic try
axh = findobj( gcf, 'Type', 'Axes' );
axh should be a three element vector
y1 = get( axh(1), 'YData' );
Try
get( axh(1) )
get( axh(2) )
get( axh(3) )
to find an appropriate property, the value of which can be used to distinguish between the axes. It might be different on R2014b.