MATLAB: How to sample data from a plot to a function.

passing data to a functionsampling data from plot

Hi evryone, Can you tell me if there is any way to obtain a discrete set of data points from a plot and use those data points later in a function. Suppose i hv a function 'Flow_inlet' in which i hv to feed data of Outlet flow at diff time instants and i have a plot of Output flow vs. time. Now how can i feed the data from the curve to the function. If it cud be done anyway then how?? Plzz enlighten me.Really need ur help. Thnxx in advance!!

Best Answer

Click on your plot then type
x= get(gco,'xdata')
y=get(gco,'ydata')