跳转到内容

File:Deviation from Mean of a Random Distribution.jpg

页面内容不支持其他语言。
這個文件來自維基共享資源
维基百科,自由的百科全书

Deviation_from_Mean_of_a_Random_Distribution.jpg (560 × 420像素,文件大小:39 KB,MIME类型:image/jpeg


摘要

描述
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
日期
来源 自己的作品
作者 Grw66

许可协议

我,本作品著作权人,特此采用以下许可协议发表本作品:
Creative Commons CC-Zero 本作品采用知识共享CC0 1.0 通用公有领域贡献许可协议授权。
采用本宣告发表本作品的人,已在法律允许的范围内,通过在全世界放弃其对本作品拥有的著作权法规定的所有权利(包括所有相关权利),将本作品贡献至公有领域。您可以复制、修改、传播和表演本作品,将其用于商业目的,无需要求授权。

说明

添加一行文字以描述该文件所表现的内容
A random distribution plotted along with mean and standard deviation.

此文件中描述的项目

描繪內容

文件历史

点击某个日期/时间查看对应时刻的文件。

日期/时间缩⁠略⁠图大小用户备注
当前2023年11月19日 (日) 22:212023年11月19日 (日) 22:21版本的缩略图560 × 420​(39 KB)Grw66Uploaded own work with UploadWizard

以下页面使用本文件:

全域文件用途

以下其他wiki使用此文件:

元数据