Message Boards Message Boards

0
|
3666 Views
|
1 Reply
|
1 Total Likes
View groups...
Share
Share this post:
GROUPS:

Mean and Standard deviation of matrix elements

Posted 10 years ago

Hi everyone; I wanted to take the mean and std dev of matrix elements or data as table form. I got a command line like this: Z2 = Pick[Z1, Table[If[OddQ[i + j], 1, 0], {i, 1, 201}, {j, 1, 201}], 1] // TableForm and want to have Mean[Z2] and StandardDeviation[Z2]. Thanks

POSTED BY: fary farfar

You probably want to leave TableForm out of Z2, because it interferes with further calculations:

(Z2 = Pick[Z1, Table[If[OddQ[i + j], 1, 0], {i, 1, 201}, {j, 1, 201}],
     1]) // TableForm

To get the Mean and StandardDeviation you need to Flatten Z2 first, unless you want the means of the columns separately:

Mean[Flatten[Z2]]
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract