Without using the built in function "mean" (Matlab)

14 ビュー (過去 30 日間)
Cristian Pablo Jimenez
Cristian Pablo Jimenez 2017 年 11 月 3 日
回答済み: Image Analyst 2017 年 11 月 3 日
How would I be able to calculate the mean of row i of a matrix "A" without using the built in function "mean"?

回答 (1 件)

Image Analyst
Image Analyst 2017 年 11 月 3 日
Just loop over columns
theSum = 0;
for col = 1 : columns
theSum = theSum + m(i, col);
end
theMean = theSum / columns;
That's really super basic programming.

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by