I have 30 files (UE1.dat, UE2.dat, ......), all of the them consist of 2 columns (the first one is the delay and the second one is its CDF). So because i don't have the CDF value for all delays in the range [100:600], i had to interpolate the second columns according to the first one in all those 30 files and after that to normalize the data between 0 and 1. Everything works perfect until now.
In the end I have to plot a graph, which consists of x, y and the y error-bars. x is the range (100:1:600), y is the mean for every row of the interpolated data for every x from 100 to 600 by step 1, and for the y error-bars I calculate the standard deviation for every y row as well.
But when I plot the data with error bars it looks weird and i have some strange x dashes, while if I plot only x against y everything looks good. Can you give me some hints how to troubleshoot the issue with the y error-bars, maybe i miss something. Below the MATLAB code is attached and the graphs as well.
clc;
close all;
clear all;
% xq1 = (100:600)
NUM_UES = 30;
NUM_SAMPLES = 501;
for i=1:NUM_UES
%% Loading data
x = load(strcat('C:\Users\tgetsov\Documents\BA THESIS\temp_200\ral\UE',num2str(i),'.cdf.dat'));
y = strcat('C:\Users\tgetsov\Documents\BA THESIS\temp_200\ral\UE',num2str(i),'.cdf.dat');
xq = 100:1:600;
Result(:, i) = interp1(x(:,1), x(:,2), xq, 'linear', 'extrap');
Result_norm(:, i) = (Result(:, i) - min(Result(:, i)))/(max(Result(:, i) - min(Result(:, i))));
end
% p=0:length(Result)-1;
%%Plotting Data
% figure(i);
% % plot(p,Result); hold on;grid;
% plot(xq_i,Result_i);
% hold on;
% grid;
for k=1:NUM_SAMPLES
avg(k) = mean(Result_norm(k,:));
min_30_ral(k) = min(Result_norm(k,:),[],2);
max_30_ral(k)= max(Result_norm(k,:),[],2);
stdev(k) = std(Result_norm(k,:))*ones(size(xq(:, k)));
variance(k) = var(Result_norm(k, :));
end
v = variance;
v2 = zeros(size(v));
v2(1:50:end) = v(1:50:end);
m = stdev;
m2 = zeros(size(m));
m2(1:50:end) = m(1:50:end);
% [F , X] = ecdf(avg)
figure (1)
% errorbar(xq,avg,min_30_ral,max_30_ral);
% errorbar(xq,avg,m2);
% errorbar(xq,avg,v2);
errorbar(xq,avg,m2);
hold on;
grid;
figure (2)
plot (xq, avg);
hold on;
grid;
x against y:
x against y with error bars:

