How to extract the Y data value from the all X value required in the plotted 2D graph in an array?

1 次查看(过去 30 天)
Hi all,
I have a graph plotting Y(BER value) vs X(SNR) value in 2D plot graph. I want to extract all the value of Y against its value of X in an array. anyone can help me please?
i have the code as below =============================================================================
BER2 = sum(total_bit_error)/(length(data)*iteration); figure; % BER vs SNR in linear value
hold on
plot(snr,BER,'gx-',snr,BER1,'bs-',snr,BER2,'ro-');
yticks = (0 : 0.01 :0.8);
xticks = (0 : 1 : 25);
set(gca,'YTick', yticks, 'YTickLabel', cellstr(num2str(yticks(:))) )
set(gca,'XTick', xticks, 'XTickLabel', cellstr(num2str(xticks(:))) )
grid on
xlabel('\fontname{calibri}{SNR}')
ylabel('\fontname{calibri}{BER}')
title('\fontsize{10}{BER vs SNR }')
legend('1','11','3')

回答(1 个)

Image Analyst
Image Analyst 2013-3-25
I don't understand -- what is there to extract? And extract from what? Extract all Y? But you already have all Y in the variable called BER, and you already have all the X in the variable called SNR. So what else do you need?
  2 个评论
fiteri razali
fiteri razali 2013-3-27
ok..it is like this..with this code it will plot a graph y vs x..in the graph it has 3 output which is 1,11 and 3.but then i need all the values of y from its respective value of v from the graph in array so that i can put the value in a table for further calculation...with the code it will only produce a graph.any suggestion?
Image Analyst
Image Analyst 2013-3-27
I still don't understand. Anything that you plotted, you have the variables for. So just put those variables into a table (I don't know if that is a 2D matrix, something displayed on a GUI, or a uicontrol that is like a spreadsheet).

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by