⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 figuremaker2.m

📁 RFID系统密集读写PPC算法的设计和仿真
💻 M
字号:
clear all;
reader_m;

filterdir = 'Filter';
figdir = 'Figure';
ppcname = 'Results_PPC';
dapcname = 'Results_DAPC';

%Varying Size, Fix Density
for mindists = 1:length(mindist)
    
    %Mean Range plot
    figure;
    for m = 1:length(a)
        dataname = strcat(filterdir, '/', ppcname, '_MEAN_RANGE_FIX_DENSITY_VAR_SIZE_', num2str(mindist(mindists)), '_a', num2str(a(m)), '_b', num2str(b(m)), '.mat');
        load(dataname);
        h = plot(nn, meanplot_ppc ,strcat(color(m),'-.',shape(m)), 'lineWidth', 1);
        hold on;
    end

    for n = 1:length(jj)
        dataname = strcat(filterdir, '/', dapcname, '_MEAN_RANGE_FIX_DENSITY_VAR_SIZE_', num2str(mindist(mindists)), '_M', num2str(n), '.mat');
        load(dataname);
        h = plot(nn, meanplot_dapc , strcat(color(m+n),'-',shape(m+n)), 'lineWidth', 1);
        hold on;
    end
    
    titlename = sprintf('Minimum distance of %s meters', num2str(mindist(mindists)));
    title(titlename);
    xlabel('Number readers in the network');
    ylabel('Average detection range (meters)');
    legend('PPC Beta(0.1,0.1)', 'PPC Beta(2,2)', 'DAPC', 4);
    axis([5 60 0 2.5]);
    set(gca,'XTick',nn);
    plotname = strcat(figdir, '/MEAN_RANGE_FIX_DENSITY_VAR_SIZE_', num2str(mindist(mindists)), '.emf');
    eval(['print -dmeta ' plotname]);
    close;
    
    %STD Range plot
    figure;
    for m = 1:length(a)
        dataname = strcat(filterdir, '/', ppcname, '_STD_RANGE_FIX_DENSITY_VAR_SIZE_', num2str(mindist(mindists)), '_a', num2str(a(m)), '_b', num2str(b(m)), '.mat');
        load(dataname);
        h = plot(nn, stdplot_ppc ,strcat(color(m),'-.',shape(m)), 'lineWidth', 1);
        hold on;
    end

    for n = 1:length(jj)
        dataname = strcat(filterdir, '/', dapcname, '_STD_RANGE_FIX_DENSITY_VAR_SIZE_', num2str(mindist(mindists)), '_M', num2str(n), '.mat');
        load(dataname);
        h = plot(nn, stdplot_dapc , strcat(color(m+n),'-',shape(m+n)), 'lineWidth', 1);
        hold on;
    end
    
    titlename = sprintf('Minimum distance of %s meters', num2str(mindist(mindists)));
    title(titlename);
    xlabel('Number readers in the network');
    ylabel('Standard deviation of read range');
    legend('PPC Beta(0.1,0.1)', 'PPC Beta(2,2)', 'DAPC', 4);
    axis([5 60 0 0.5]);
    set(gca,'XTick',nn);
    plotname = strcat(figdir, '/STD_RANGE_FIX_DENSITY_VAR_SIZE_', num2str(mindist(mindists)), '.emf');
    eval(['print -dmeta ' plotname]);
    close;    
        
    %STD Percentage plot
    figure;
    for m = 1:length(a)
        dataname = strcat(filterdir, '/', ppcname, '_STD_PERC_FIX_DENSITY_VAR_SIZE_', num2str(mindist(mindists)), '_a', num2str(a(m)), '_b', num2str(b(m)), '.mat');
        load(dataname);
        h = plot(nn, stdplot_ppc ,strcat(color(m),'-.',shape(m)), 'lineWidth', 1);
        hold on;
    end

    for n = 1:length(jj)
        dataname = strcat(filterdir, '/', dapcname, '_STD_PERC_FIX_DENSITY_VAR_SIZE_', num2str(mindist(mindists)), '_M', num2str(n), '.mat');
        load(dataname);
        h = plot(nn, stdplot_dapc , strcat(color(m+n),'-',shape(m+n)), 'lineWidth', 1);
        hold on;
    end
    
    titlename = sprintf('Minimum distance of %s meters', num2str(mindist(mindists)));
    title(titlename);
    xlabel('Number readers in the network');
    ylabel('Standard deviation of percentage of time');
    legend('PPC Beta(0.1,0.1)', 'PPC Beta(2,2)', 'DAPC', 4);
    %axis([5 60 0 0.5]);
    set(gca,'XTick',nn);
    plotname = strcat(figdir, '/STD_PERC_FIX_DENSITY_VAR_SIZE_', num2str(mindist(mindists)), '.emf');
    eval(['print -dmeta ' plotname]);
    close;
    
    %Mean percentage plot
    figure;
    for m = 1:length(a)
        dataname = strcat(filterdir, '/', ppcname, '_MEAN_PERC_FIX_DENSITY_VAR_SIZE_', num2str(mindist(mindists)), '_a', num2str(a(m)), '_b', num2str(b(m)), '.mat');
        load(dataname);
        h = plot(nn, mpplot_ppc ,strcat(color(m),'-.',shape(m)), 'lineWidth', 1);
        hold on;
    end

    for n = 1:length(jj)
        dataname = strcat(filterdir, '/', dapcname, '_MEAN_PERC_FIX_DENSITY_VAR_SIZE_', num2str(mindist(mindists)), '_M', num2str(n), '.mat');
        load(dataname);
        h = plot(nn, mpplot_dapc ,strcat(color(m+n),'-',shape(m+n)), 'lineWidth', 1);
        hold on;
    end

    titlename = sprintf('Minimum distance of %s meters', num2str(mindist(mindists)));
    title(titlename);
    xlabel('Number readers in the network');
    ylabel('Percentage of time achieving desired range');
    legend('PPC Beta(0.1,0.1)', 'PPC Beta(2,2)', 'DAPC', 4);
    axis([5 60 0 100]);
    set(gca,'XTick', nn);
    plotname = strcat(figdir, '/MEAN_PERC_FIX_DENSITY_VAR_SIZE_', num2str(mindist(mindists)), '.emf');
    eval(['print -dmeta ' plotname]);
    close;
    
    %Mean Power plot
    figure;
    for m = 1:length(a)
        dataname = strcat(filterdir, '/', ppcname, '_MEAN_POWER_FIX_DENSITY_VAR_SIZE_', num2str(mindist(mindists)), '_a', num2str(a(m)), '_b', num2str(b(m)), '.mat');
        load(dataname);
        h = plot(nn, mpowerplot_ppc*100 ,strcat(color(m),'-.',shape(m)), 'lineWidth', 1);
        hold on;
    end

    for n = 1:length(jj)
        dataname = strcat(filterdir, '/', dapcname, '_MEAN_POWER_FIX_DENSITY_VAR_SIZE_', num2str(mindist(mindists)), '_M', num2str(n), '.mat');
        load(dataname);
        h = plot(nn, mpowerplot_dapc*100 , strcat(color(m+n),'-',shape(m+n)), 'lineWidth', 1);
        hold on;
    end
    
    titlename = sprintf('Minimum distance of %s meters', num2str(mindist(mindists)));
    title(titlename);
    xlabel('Number readers in the network');
    ylabel('Average reader output power (mW)');
    legend('PPC Beta(0.1,0.1)', 'PPC Beta(2,2)', 'DAPC', 4);
    axis([4.99 60 0 1000]);
    set(gca,'XTick',nn);
    plotname = strcat(figdir, '/MEAN_POWER_FIX_DENSITY_VAR_SIZE_', num2str(mindist(mindists)), '.emf');
    eval(['print -dmeta ' plotname]);
    close;    
    
    %Mean Interference plot
    figure;
    for m = 1:length(a)
        dataname = strcat(filterdir, '/', ppcname, '_MEAN_INTER_FIX_DENSITY_VAR_SIZE_', num2str(mindist(mindists)), '_a', num2str(a(m)), '_b', num2str(b(m)), '.mat');
        load(dataname);
        h = plot(nn, 10*log10(minterplot_ppc/100) ,strcat(color(m),'-.',shape(m)), 'lineWidth', 1);
        hold on;
    end

    for n = 1:length(jj)
        dataname = strcat(filterdir, '/', dapcname, '_MEAN_INTER_FIX_DENSITY_VAR_SIZE_', num2str(mindist(mindists)), '_M', num2str(n), '.mat');
        load(dataname);
        h = plot(nn, 10*log10(minterplot_dapc/100) , strcat(color(m+n),'-',shape(m+n)), 'lineWidth', 1);
        hold on;
    end
    
    titlename = sprintf('Minimum distance of %s meters', num2str(mindist(mindists)));
    title(titlename);
    xlabel('Number readers in the network');
    ylabel('Average Interference (dBm)');
    legend('PPC Beta(0.1,0.1)', 'PPC Beta(2,2)', 'DAPC', 4);
    %axis([5 60 ]);
    set(gca,'XTick',nn);
    plotname = strcat(figdir, '/MEAN_INTER_FIX_DENSITY_VAR_SIZE_', num2str(mindist(mindists)), '.emf');
    eval(['print -dmeta ' plotname]);
    close;    
end

%Varying Density, Fix Size
for runs = 1:length(nn)
    
    %Mean range plot
    figure;
    for m = 1:length(a)
        dataname = strcat(filterdir, '/', ppcname, '_MEAN_RANGE_FIX_SIZE_VAR_DENSITY_', num2str(nn(runs)), '_a', num2str(a(m)), '_b', num2str(b(m)), '.mat');
        load(dataname);
        h = plot(mindist, meanplot_ppc ,strcat(color(m),'-.',shape(m)), 'lineWidth', 1);
        hold on;
    end

    for n = 1:length(jj)
        dataname = strcat(filterdir, '/', dapcname, '_MEAN_RANGE_FIX_SIZE_VAR_DENSITY_', num2str(nn(runs)), '_M', num2str(n), '.mat');
        load(dataname);
        h = plot(mindist, meanplot_dapc , strcat(color(m+n),'-',shape(m+n)), 'lineWidth', 1);
        hold on;
    end
    
    titlename = sprintf('Network with %s readers', num2str(nn(runs)));
    title(titlename);
    xlabel('Minimum distance between readers (meters)');
    ylabel('Average detection range (meters)');
    legend('PPC Beta(0.1,0.1)', 'PPC Beta(2,2)', 'DAPC', 4);    
    %legend('PPC [\alpha = 0.1, \beta = 0.1]', 'PPC [\alpha = 2, \beta = 2]', 'DAPC [j = 3, k = 2]', 'DAPC [j = 10, k = 8]', 4);
    axis([4.99 14 0 2.5]);
    set(gca,'XTick', mindist);
    plotname = strcat(figdir, '/MEAN_RANGE_FIX_SIZE_VAR_DENSITY_', num2str(nn(runs)), '.emf');
    eval(['print -dmeta ' plotname]);
    close;
    
    %Mean percentage plot
    figure;
    for m = 1:length(a)
        dataname = strcat(filterdir, '/', ppcname, '_MEAN_PERC_FIX_SIZE_VAR_DENSITY_', num2str(nn(runs)), '_a', num2str(a(m)), '_b', num2str(b(m)), '.mat');
        load(dataname);
        h = plot(mindist, mpplot_ppc ,strcat(color(m),'-.',shape(m)), 'lineWidth', 1);
        hold on;
    end

    for n = 1:length(jj)
        dataname = strcat(filterdir, '/', dapcname, '_MEAN_PERC_FIX_SIZE_VAR_DENSITY_', num2str(nn(runs)), '_M', num2str(n), '.mat');
        load(dataname);
        h = plot(mindist, mpplot_dapc ,strcat(color(m+n),'-',shape(m+n)), 'lineWidth', 1);
        hold on;
    end
    titlename = sprintf('Network with %s nodes', num2str(nn(runs)));
    title(titlename);
    xlabel('Minimum distance between readers (meters)');
    ylabel('Percentage of time achieving desired range');
    legend('PPC Beta(0.1,0.1)', 'PPC Beta(2,2)', 'DAPC', 4);
    axis([5 14 0 100]);
    set(gca,'XTick', mindist);
    plotname = strcat(figdir, '/MEAN_PERC_FIX_SIZE_VAR_DENSITY_', num2str(nn(runs)), '.emf');
    eval(['print -dmeta ' plotname]);  
    close;
    
    %Mean power plot
    figure;
    for m = 1:length(a)
        dataname = strcat(filterdir, '/', ppcname, '_MEAN_POWER_FIX_SIZE_VAR_DENSITY_', num2str(nn(runs)), '_a', num2str(a(m)), '_b', num2str(b(m)), '.mat');
        load(dataname);
        h = plot(mindist, mpowerplot_ppc*100 ,strcat(color(m),'-.',shape(m)), 'lineWidth', 1);
        hold on;
    end

    for n = 1:length(jj)
        dataname = strcat(filterdir, '/', dapcname, '_MEAN_POWER_FIX_SIZE_VAR_DENSITY_', num2str(nn(runs)), '_M', num2str(n), '.mat');
        load(dataname);
        h = plot(mindist, mpowerplot_dapc*100 ,strcat(color(m+n),'-',shape(m+n)), 'lineWidth', 1);
        hold on;
    end
    titlename = sprintf('Netowork with %s nodes', num2str(nn(runs)));
    title(titlename);
    xlabel('Minimum distance between readers (meters)');
    ylabel('Average reader output power (mW)');
    legend('PPC Beta(0.1,0.1)', 'PPC Beta(2,2)', 'DAPC', 4);
    axis([4.99 14 0 1000]);
    set(gca,'XTick', mindist);
    plotname = strcat(figdir, '/MEAN_POWER_FIX_SIZE_VAR_DENSITY_', num2str(nn(runs)), '.emf');
    eval(['print -dmeta ' plotname]);  
    close;
    
    %Mean intereference plot
    figure;
    for m = 1:length(a)
        dataname = strcat(filterdir, '/', ppcname, '_MEAN_INTER_FIX_SIZE_VAR_DENSITY_', num2str(nn(runs)), '_a', num2str(a(m)), '_b', num2str(b(m)), '.mat');
        load(dataname);
        h = plot(mindist, 10*log10(minterplot_ppc/100) ,strcat(color(m),'-.',shape(m)), 'lineWidth', 1);
        hold on;
    end

    for n = 1:length(jj)
        dataname = strcat(filterdir, '/', dapcname, '_MEAN_INTER_FIX_SIZE_VAR_DENSITY_', num2str(nn(runs)), '_M', num2str(n), '.mat');
        load(dataname);
        h = plot(mindist, 10*log10(minterplot_dapc/100) ,strcat(color(m+n),'-',shape(m+n)), 'lineWidth', 1);
        hold on;
    end
    titlename = sprintf('Netowork with %s nodes', num2str(nn(runs)));
    title(titlename);
    xlabel('minimum distance between readers (meters)');
    ylabel('Average interference experienced (dBm)');
    legend('PPC Beta(0.1,0.1)', 'PPC Beta(2,2)', 'DAPC', 4);
    %axis([4.99 14 -100 -60]);
    set(gca,'XTick', mindist);
    plotname = strcat(figdir, '/MEAN_INTER_FIX_SIZE_VAR_DENSITY_', num2str(nn(runs)), '.emf');
    eval(['print -dmeta ' plotname]);
    close;
    
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -