cancel
Showing results for
Did you mean:
cancel
Showing results for
Did you mean:

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

1-Newbie

## getting the mean of a submatrix

Hello all,

I have a matrix of vectors. I plotted one of the vectors below.

Can someone tell me the "proper" or most elegant way of calculating the mean of the values?
I have a mild flu and it's hard for me to concentrate, so I thought someone could nudge me along

TIA

10 REPLIES 10
24-Ruby V
(To:JasonC)

Its not absolutely clear to me which mean of which values you are looking for.

Maybe you can setup a simplified sheet and post it here and tell us the desired result.

18-Opal
(To:JasonC)

Here are a few possibilities:

1-Newbie
(To:MJG)

I have a 1x7 matrix of 10x1 matrices. (below)
I'd like the mean of say, the 5th element (cue Mila Jovovich ) of the 10-element matrices.

23-Emerald III
(To:JasonC)

This should do what you want, and possibly more:

Success!

Luc

24-Ruby V
(To:JasonC)

Sorry, still not sure

 Jason Cuadra wrote: I have a 1x7 matrix of 10x1 matrices. (below)I'd like the mean of say, the 5th element (cue Mila Jovovich ) of the 10-element matrices.

Does this mean that you want to get the mean of the fith 10 x 1 vector or would you like the mean of the seven values which are at the 5th position of each 10 x 1 matrix.

The first would be easy by just using mean(data[0,5).

1-Newbie
(To:Werner_E)

I want the mean of the seven values which are at the 5th position of each 10 x 1 matrix.

24-Ruby V
(To:JasonC)
 Jason Cuadra wrote: I want the mean of the seven values which are at the 5th position of each 10 x 1 matrix.

So I guess you already have the solution - see below 😉

24-Ruby V
(To:JasonC)

Here are some ways to calculate the one or the other mean value:

1-Newbie
(To:JasonC)

OK guys, it seems that there isn't a one-liner way to do what I need; a procedure needs to be written.

Thanks ll

23-Emerald I
(To:JasonC)

I can do it in two steps:

Announcements
Top Tags