Nusers = 2;

s = [
    10
     0
      0.00125
     0.046667
        0.005
         0.13
    20
    10
   0.00083333
      0.04375
    0.0083333
      0.11083
    30
    20
      0.00125
     0.053333
    0.0054167
         0.14
];

n = length(s)/(Nusers*3);

s = reshape(s,Nusers,3,n);

% s(u,1,:) = SNR
% s(u,2,:) = BER_known
% s(u,3,:) = BER_gm

snr = s(:,1,:);
snr = snr(:);
snr_min = min(snr);
snr_max = max(snr);

hold off

%%%
%%
% user #1
%
u = 1;

snr = s(u,1,:);
snr = snr(:);

ber_known = s(u,2,:);
ber_known = ber_known(:);

ber_gm = s(u,3,:);
ber_gm = ber_gm(:);

subplot(2,2,1)

semilogy(snr,ber_known,'-*');
hold on
semilogy(snr,ber_gm,'--x');

a = axis;
axis([snr_min snr_max a(3) a(4)])

legend('Known','GM',3)
xlabel 'SNR'
ylabel 'BER'
title 'User #1'

%%%
%%
% user #2
%
u = 2;

snr = s(u,1,:);
snr = snr(:);

ber_known = s(u,2,:);
ber_known = ber_known(:);

ber_gm = s(u,3,:);
ber_gm = ber_gm(:);

subplot(2,2,3)

semilogy(snr,ber_known,'-*');
hold on
semilogy(snr,ber_gm,'--x');

a = axis;
axis([snr_min snr_max a(3) a(4)])

% legend('Known','GM',1)
xlabel 'SNR'
ylabel 'BER'
title 'User #2'
