average and standard deviation
2 ビュー (過去 30 日間)
古いコメントを表示
I need help writing a program that computes and returns the average and standard deviation of the elements in a vector x, without using the built in mean and std functions.
0 件のコメント
回答 (1 件)
Image Analyst
2014 年 10 月 17 日
It's just a simple for loop to sum the variable.
theSum = 0;
for k = 1 : length(x)
theSum = theSum + x(k);
end
theMean = theSum / length(x);
For the SD, it's very very similar - try it yourself this time. If you need to learn MATLAB, check this out: http://www.mathworks.com/matlabcentral/answers/8026-best-way-s-to-master-matlab
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Descriptive Statistics and Visualization についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!