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?

Rayleigh fading

  • 1
    $\begingroup$ This question appears to be off-topic because it is less about signal processing and more about executing procedures in Matlab. $\endgroup$
    – jonsca
    Oct 13 '13 at 8:57
  • $\begingroup$ @jonsca I guess you are right. Should I delete it from here and post it in stack overflow maybe? $\endgroup$
    – Mun
    Oct 13 '13 at 10:07
  • $\begingroup$ 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. $\endgroup$
    – jonsca
    Oct 13 '13 at 10:14
  • $\begingroup$ @jonsca.. True. Maybe I can also get some ideas on how to do more analysis of the above graph. $\endgroup$
    – 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.

Is this what you meant? If not, please let me know and I'll try to explain better...


Not the answer you're looking for? Browse other questions tagged or ask your own question.