English: See below for Matlab code.
% Generate some random data
x = 1:25; y = 20*rand(1,25)+10;
% Calculate the mean and standard deviation of y
y_mean = mean (y);
y_std = std (y);
% Plot y versus x with a line
plot(x,y,'b', 'LineWidth', 2); hold on
% Plot the mean of y as a dashed line plot
plot(x,y_mean*ones(size(x)), 'k--');
% plot(x,median(y)*ones(size(x)),'r--')
% Plot the error bars for y using one standard deviation
% errorbar(x,y,y_std*ones (size (y)), 'b', 'LineStyle', 'none');
% Plot the shaded area for y using one standard deviation
y_upper = y_mean + y_std;
y_lower = y_mean - y_std;
x_fill = [x, fliplr(x)];
y_fill = [y_upper, fliplr(y_lower)];
fill([min(x_fill), max(x_fill), max(x_fill), min(x_fill)],[y_fill(2), y_fill(2), y_fill(1), y_fill(1)], 'r', 'FaceAlpha', 0.2, 'EdgeColor', 'none');
% fill (x_fill, y_fill, 'b', 'FaceAlpha', 0.2, 'EdgeColor', 'none');
% Add some labels and legends
xlabel ('Data Observation');
ylabel ('Y'); grid on; title('Deviation from Mean in Random Distribution')
legend ('Data', 'Mean', 'Standard Deviation', 'Location', 'best');
ylim([10 40]); hold off