# MATLAB: Getting the data point from two plotted curves in one figure

data acquisitionplot

Hi all, I am using Matlab R2017b that runs on Windows Server 2012 R2.
I have two curves on the a single figure and I want to export the data point of theses curves to different variables and save them later for further manipulation.
When I run the following code:
h = findobj(gca,'Type','line')x=get(h,'Xdata')y=get(h,'Ydata')
I get the data points of imag(neff).
My problem is that I want to get the y point of the second curve real(neff). How can I get the data points of real(neff) into a separate variable?

h  = findobj(gca, 'Type', 'line');x1 = get(h(1), 'XData')y1 = get(h(1), 'YData')x2 = get(h(2), 'XData')y2 = get(h(2), 'YData')
h = findobj(gca, 'Type', 'line');x = get(h, 'XData')
h = findobj(gcf, 'Type', 'line')