MATLAB HELP STANDARD DEVIATION, MEAN, HISTOGRAMS
12 次查看(过去 30 天)
显示 更早的评论
PLEASE LEAVE NOTES SO I M
AY UNDERSTAND THE STEPS ON HOW TO FIND THE STANDARD DEVIATION AND MEAN

0 个评论
回答(2 个)
Meg Noah
2025-8-5,23:55
Try this:
force_lbs = [243,236,389,628,143,417,205,404,464,605,137,123,372,439,...
497,500,535,577,441,231,675,132,196,217,660,569,865,725,547,347];
mean_lbs = mean(force_lbs);
std_lbs = std(force_lbs);
fprintf(1,'Mean force = %f [lbs]\nStandard Deviation force=%f [lbs]\n' ,...
mean_lbs,std_lbs);
edges_lbs = linspace(-3*std_lbs+mean_lbs,3*std_lbs+mean_lbs,13);
histogram(force_lbs,edges_lbs);
% 68% of the population is approx within 1 standard deviation of the mean
x = norminv([(1-0.68)/2 (1-0.68)/2+0.68]);
upper_limit_68 = mean_lbs + x(2)*std_lbs;
lower_limit_68 = mean_lbs + x(1)*std_lbs;
percentage_in_limit_68 = 100* ...
sum(lower_limit_68 <= force_lbs & force_lbs <= upper_limit_68)/numel(force_lbs);
fprintf(1,'%.4f%s are within the normal 68%s limits [%.4f,%.4f] lbs\n', ...
percentage_in_limit_68, ...
'%','%',lower_limit_68,upper_limit_68);
% 96% of the population is approx within 2.1 standard deviation of the mean
x = norminv([(1-0.96)/2 (1-0.96)/2+0.96]);
upper_limit_96 = mean_lbs + x(2)*std_lbs;
lower_limit_96 = mean_lbs + x(1)*std_lbs;
percentage_in_limit_96 = 100* ...
sum(lower_limit_96 <= force_lbs & force_lbs <= upper_limit_96)/numel(force_lbs);
fprintf(1,'%.4f%s are within the normal 96%s limits [%.4f,%.4f] lbs\n', ...
percentage_in_limit_96, ...
'%','%',lower_limit_96,upper_limit_96);
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Histograms 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!