How do I find the mean of a multidimensional array?
14 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Delany MacDonald
il 31 Mar 2016
Commentato: Star Strider
il 31 Mar 2016
How do i find the mean of a 21 x 6 array and get a single answer? When i try to do it I am given 6 answers.
0 Commenti
Risposta accettata
Star Strider
il 31 Mar 2016
Use the single ‘:’ array reference to create a column vector out of any N-dimensional array:
A = randi(99, 6); % Create Data
MeanA = mean(A(:))
MeanA =
57.25
2 Commenti
Star Strider
il 31 Mar 2016
My pleasure!
No ‘duh’, though. Really.
MATLAB is a large language with an accordingly large documentation. I’ve been here a while, I’ve been working with MATLAB since 1994, and I’m still learning about functions and features, especially since these expand with nearly every release.
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!