# Extracting data from matlab graph [closed]

I do not seem to know how to extract from a Matlab plot. For example in the plot given below, I have a simulated $P_b$ for Rayleigh fading and theoretical AWGN channel Pb plot against SNR ($\large \frac{E_b}{N_o}$).

My question is how do I get the value of $\large \frac{E_b}{N_o}$ for a particular value of $P_b$. For example, if I want the read the $\large \frac{E_b}{N_o}$ from the graph to get a probability bit error for the Rayleigh channel, what code can I use?

• This question appears to be off-topic because it is less about signal processing and more about executing procedures in Matlab. Oct 13 '13 at 8:57
• @jonsca I guess you are right. Should I delete it from here and post it in stack overflow maybe?
– Mun
Oct 13 '13 at 10:07
• Others may disagree with me, so I wouldn't carry that out until there is more consensus. This really is a generic problem of interpolation and/or function evaluation rather than having to do with SNR, but I'm not sure if it's enough of a programming issue for SO. Oct 13 '13 at 10:14
• @jonsca.. True. Maybe I can also get some ideas on how to do more analysis of the above graph.
– Mun
Oct 13 '13 at 10:26

The data that is used to create the curves in the plot are stored in the axes object of the figure that contains the plot. You can obtain the underlying data by retrieving the axes' xdata and ydata properties. For example:
h_axes = gca; x_data = get(h_axes, 'xdata'); y_data = get(h_axes, 'ydata');
After extracting the data you can use interpolation (see e.g. interp1())to find the value that you are looking for.