1
$\begingroup$

I am trying to have a list of values which corresponds to the mean of the values of each column of a matrix. Here I show a quick example (my current matrix has a dimension of 1000 * 1000)

If I have matrix like this: matrixExample = {{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 9, 9, 9}} I would have to obtain a list like this: mean values={5, 5.7, 6.3, 7}.

$\endgroup$

closed as off-topic by Anton Antonov, MassDefect, Alex Trounev, m_goldberg, garej Jun 28 at 9:02

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Anton Antonov, MassDefect, Alex Trounev, m_goldberg, garej
If this question can be reworded to fit the rules in the help center, please edit the question.

5
$\begingroup$
matrixExample = {{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 9, 9, 9}};
Mean[matrixExample]
(*    {5, 17/3, 19/3, 7}    *)
% // N
(*    {5., 5.66667, 6.33333, 7.}    *)
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.