Without using the built in function "mean" (Matlab)
11 次查看(过去 30 天)
显示 更早的评论
How would I be able to calculate the mean of row i of a matrix "A" without using the built in function "mean"?
0 个评论
回答(1 个)
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!