-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmyplot2.m
More file actions
26 lines (23 loc) · 696 Bytes
/
myplot2.m
File metadata and controls
26 lines (23 loc) · 696 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
% plot the BER-SNR curve
% load ber data
MS = load('BER/MS.mat');
LMS = load('BER/LMS.mat');
max_len = max([length(MS.ber_res) length(LMS.ber_res)]);
% padding 0 to the same length
MS.ber_res = [MS.ber_res zeros(1,max_len-length(MS.ber_res))];
LMS.ber_res = [LMS.ber_res zeros(1,max_len-length(LMS.ber_res))];
% plot BER - SNR
snrdb = (0:0.2:(0.2*max_len-0.2));
figure;
plot(snrdb, LMS.ber_res, '--', 'color', 'r', 'LineWidth', 2);
hold on;
plot(snrdb, MS.ber_res, '--', 'color', 'g', 'LineWidth', 2);
legend('Layered MS', 'Min-Sum');
set(gca, 'YScale', 'log')
title('BER - SNR');
ylabel('BER');
xlabel('SNR [dB]');
xlim([0,4])
ylim([10^(-6),1]);
hold off;
saveas(gcf, './figure/myplot2.png')