In order to calculate the 95% confidence intervals of your signal, you first will need to calculate the mean and *|std| (standard deviation) of your experiments at each value of your independent variable. The standard way to do this is to calculate the standard error of the mean at each value of your independent variable, multiply it by the calculated 95% values of the t-distribution (here), then add and subtract those values from the mean. The plot is then straightforward. (The tinv function is in the Statistics and Machine Learning Toolbox.)
Example —
x = 1:100;
y = randn(50,100);
N = size(y,1);
yMean = mean(y);
ySEM = std(y)/sqrt(N);
CI95 = tinv([0.025 0.975], N-1);
yCI95 = bsxfun(@times, ySEM, CI95(:));
figure
plot(x, yMean)
hold on
plot(x, yCI95+yMean)
hold off
grid
This should get you started.
Best Answer