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

조회 수: 11 (최근 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 CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by