What does mean(s(:)) do and the reason for using " : " for mean of a square matrix?
Ältere Kommentare anzeigen
The working of the below mentioned and the reason for using " : " avg = mean(s(:));
Akzeptierte Antwort
Weitere Antworten (1)
(:) reshapes the array to a column vector, as described in
doc colon
This is done when taking the mean of a 2d image as a simple way to avoid having to do
mean( mean( s ) )
In the case of mean and some other functions there is a special builtin function
doc mean2
but I always use the colon notation personally.
Kategorien
Mehr zu Creating and Concatenating Matrices 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!