function []=meas_vs_sim(subcarrier_index, NFFT,FS,Frequency,X,Y, filename,plots)

filename_base='./';
% define formats
landscape = "-S930,350";
portrait  = "-S640,480";

% select format
output_format = portrait;

% Create an invisible figure.
fh = figure(1);
set(fh, "visible", "off");

% define style
set(0, "defaultlinelinewidth", 2);
set(0, "defaultaxesfontsize", 12);
set(0, "defaultaxesfontname", "Helvetica");
set(0, "defaulttextfontsize", 12);
set(0, "defaulttextfontname", "Helvetica");




load([filename_base '/Reduced_Chanel_Data_subcarrier_1.mat']);
sim_channel=EstimateChannel2(filename_base,subcarrier_index, NFFT,FS,Frequency);

%%skip 2. Measurement
sim_channel(1:6,:)=[];
Channel_Data(1:6,:)=[];

%sim_channel(2:2:end,:)=[];
%Channel_Data(2:2:end,:)=[];




plot_mrcm = [];
plot_mrcs = [];
plot_pom = [];
plot_pos = [];


for k=1:length(plots)
    fprintf('subplot %d: %s\n', k, plots{k});
    switch plots{k}
        case 'MRCs'
            fprintf('MRCs subplot found\n')
            plot_mrcs = [plot_mrcs k];
            %min_processing_step = max(min_processing_step, 3);
        case 'MRCm'
            fprintf('MCm subplot found\n')
            plot_mrcm = [plot_mrcm k];
            %min_processing_step = max(min_processing_step, 1);
        case 'POm'
            fprintf('POm subplot found\n')
            plot_pom = [plot_pom k];
            %min_processing_step = max(min_processing_step, 7);
        case 'POs'
            fprintf('POs subplot found\n')
            plot_pos = [plot_pos k];
            %min_processing_step = max(min_processing_step, 8);
        case 'ZFs'
            fprintf('POs subplot found\n')
            plot_pos = [plot_pos k];
            %min_processing_step = max(min_processing_step, 8);
        otherwise
            fprintf('Subplot unknown or not implemented!\n')
            plot_other = [plot_other k];
    end
end



if length(plot_mrcm)>0
    subplot(2,2,plot_mrcm);
    plot_MRC(r_Position,Channel_Data,X,Y)
    title('MRC procoding, measured channel');
end

if length(plot_mrcs)>0
    subplot(2,2,plot_mrcs);
    plot_MRC(r_Position,sim_channel,X,Y)
    title('MRC procoding, simulated channel');
end

if length(plot_pom)>0
    subplot(2,2,plot_pom);
    plot_PO(r_Position,Channel_Data,X,Y)
    title('PO procoding, measured channel');
end

if length(plot_pos)>0
    subplot(2,2,plot_pos);
    plot_PO(r_Position,sim_channel,X,Y)
    title('PO procoding, simulated channel');
end
% Create an image file. This png image is displayed on the webpage. Its size 
% must be 640x480.
print(filename, "-dpng", output_format);

end
