HELP ME PLEASE with this geometric mean
1 回表示 (過去 30 日間)
古いコメントを表示
how can I make the geometric mean in a matrix of 20x15 with only the positive numbers?
0 件のコメント
回答 (2 件)
Bruno Luong
2020 年 10 月 31 日
編集済み: Bruno Luong
2020 年 10 月 31 日
Assuming A is the vector of your data
geomean = exp(mean(log(A)))
0 件のコメント
Ameer Hamza
2020 年 10 月 31 日
You can do it like this
x = randn(20, 15);
x_positive = x(x>0);
geo_mean = prod(x_positive)^(1/numel(x_positive))
1 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!