フィルターのクリア

average and standard deviation of one column of a matrix

1 回表示 (過去 30 日間)
altaf ahmed
altaf ahmed 2019 年 5 月 5 日
コメント済み: per isakson 2019 年 5 月 7 日
I want to calcualte the average and standard deviation for one column of a 1000x10 matrix.
Is there a quicker/efficient way or should I use existing code :
theSum = 0;
for k = 1 : length(x)
theSum = theSum + x(k);
end
theMean = theSum / length(x);

採用された回答

per isakson
per isakson 2019 年 5 月 5 日
編集済み: per isakson 2019 年 5 月 5 日
  2 件のコメント
altaf ahmed
altaf ahmed 2019 年 5 月 5 日
Few more question as it was not clear to me hence asking - My data in the matrix is delay values, so can these std and mean commands be operated on an entire matrix of 1000x10 i.e. result is obtained based on all columns rather than just one?
2- Also is there a way to build up histogram data based on this matrix, e.g. below:
2a- number of occurences for minimum value, maximum value and average value
2b- how to obtain 90 percentile from this data (i.e., the delay that is surpassed by at most 10% of the occurences)
per isakson
per isakson 2019 年 5 月 7 日
"result is obtained based on all columns rather than just one? " Yes
X = rand(5);
mean(X(:)), std(X(:))
"2a- number of occurences for ..." The values of the "matrix of 1000x10" are they whole numbers?
"2b- how to obtain 90 percentile" see prctile Percentiles of a data set

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTime Series についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by