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

How would I be able to calculate the mean of row i of a matrix "A" without using the built in function "mean"?

Antworten (1)

Image Analyst
Image Analyst am 3 Nov. 2017

0 Stimmen

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.

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by