From: Virginie on
Hi
I am working on a program and the values of the ordinates are in a loop, so they are estimated very slowly and displayed in the command windows. however, i would like to see the values of the ordinates in function of the x values in a figure.
There is a demo in the communication toolbox, Introduction to mimo .m filele in Matlab that does quite the same thing, I would like to apply the same principle to my own code but I don't know how to proceed.
Can anyone help?
Thank you!

here is the program copied-pasted:

load ostbcRes.mat;

% Set up a figure for visualizing BER results
clf(h); grid on; hold on; set(h, 'renderer', 'zbuffer');
set(gca, 'yscale', 'log', 'xlim', [EbNo(1), EbNo(end)], 'ylim', [1e-5 1]);
xlabel('Eb/No (dB)'); ylabel('BER'); set(h,'NumberTitle','off');
set(h,'Name','Orthogonal Space-Time Block Coding(2)');
title('G4-coded 4x1 System and Other Comparisons');

% Plot results
semilogy(EbNo, ber11, 'r*', EbNo, ber41, 'ms', EbNo, ber22, 'c^', ...
EbNo, ber14, 'ko');
legend('No Diversity (1Tx, 1Rx), BPSK', 'OSTBC (4Tx, 1Rx), QPSK', ...
'Alamouti (2Tx, 2Rx), BPSK', 'Maximal-Ratio Combining (1Tx, 4Rx), BPSK');

% Perform curve fitting
fitBER11 = berfit(EbNo, ber11);
fitBER41 = berfit(EbNo(1:9), ber41(1:9));
fitBER22 = berfit(EbNo(1:8), ber22(1:8));
fitBER14 = berfit(EbNo(1:7), ber14(1:7));
semilogy(EbNo, fitBER11, 'r', EbNo(1:9), fitBER41, 'm', ...
EbNo(1:8), fitBER22, 'c', EbNo(1:7), fitBER14, 'k'); hold off;