clc; clear; close all; tic; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% plot setting %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% file path FilePath = '.\'; BerThres = 5e-6; %% Plot coeffcients FontName = 'Times New Roman'; % FontName = 'Arial'; FontSize = 9; MarkSize = 4; LineWid = 2; %limit setting AxW = 2.25; AxH = 2; PlotMinW = 1; PlotMinH = 1; PlotMaxW = 3.4;%AxW*2; PlotMaxH = 2.6; %figure setting AxScale = 0.82;%0.7; %% Fig.position Fig1 = figure; Fig1.Units = 'inches'; Fig1.InnerPosition = [PlotMinW, PlotMinH, PlotMaxW, PlotMaxH]; % colormap parula%jet%autumn%winter% ax1 = axes; ax1.InnerPosition = [0.15 0.13 0.97-0.15 0.995-0.13];%position with labels %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% plot %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% NumPattern = 100; %HD-FEC limit p(1) = semilogy(ax1, [0 NumPattern], [4.7e-3 4.7e-3],'k-', ... 'LineWidth', LineWid, 'DisplayName', 'HD-FEC limit'); hold on; %% stronger turbulence FileName = 'Scan_10x12.mat'; load([FilePath,FileName],'SCAN'); SicBerAvg = SCAN.SicBerAvg; SicBerAvg(SicBerAvg == 0) = 1e-8; p(4) = semilogy(ax1, 1:NumPattern, SicBerAvg,... 'ro-','MarkerSize',MarkSize, 'DisplayName', 'SIC'); hold on; p(5) = semilogy(ax1, [0 NumPattern], repmat(mean(SCAN.SicBerAvg),2,1),... 'r--', 'LineWidth', LineWid, 'DisplayName', 'SIC. Avg'); hold on; MmseBerAvg = SCAN.MmseBerAvg; MmseBerAvg(MmseBerAvg == 0) = 1e-8; p(2) = semilogy(ax1, 1:NumPattern, MmseBerAvg,... 'bs-','MarkerSize',MarkSize, 'DisplayName', 'MMSE'); hold on; p(3) = semilogy(ax1, [0 NumPattern], repmat(mean(SCAN.MmseBerAvg),2,1),... 'b:', 'LineWidth', LineWid, 'DisplayName', 'MMSE. Avg'); hold on; xlabel('Turbulence realizations'); yticks(10.^[ -8 -6 -5 -4 -3 -2 -1]) yticklabels({'<10^{-6}','10^{-6}','10^{-5}','10^{-4}','10^{-3}','10^{-2}','10^{-1}'}) ylabel('BER'); % yticklabels({'0','-6','-5','-4','-3','-2','-1'}) % ylabel('log_{10}(BER)'); ax1.FontName = FontName; ax1.FontSize = FontSize; axis([0 NumPattern 1e-8 1]) grid on;%grid minor r = rectangle('Position',[1 8.5e-2 98 7e-1]','FaceColor','white'); lgd1 = legend(p(1:3),'Position',[0.56 0.96 0 0],'Orientation','horizontal'); set(lgd1,'box','off') lgd1.ItemTokenSize = [20,1]; ax2=axes('position',get(gca,'position'),'visible','off'); ax2.FontName = FontName; ax2.FontSize = FontSize; lgd2 = legend(ax2,p(4),'Position',[0.547 0.91 0 0],'Orientation','horizontal'); set(lgd2,'box','off') lgd2.ItemTokenSize = [20,1]; ax3=axes('position',get(gca,'position'),'visible','off'); ax3.FontName = FontName; ax3.FontSize = FontSize; lgd2 = legend(ax3,p(5),'Position',[0.797 0.91 0 0],'Orientation','horizontal'); set(lgd2,'box','off') lgd2.ItemTokenSize = [20,1]; % axis equal; toc;