How to get the mean value?

Hi Everyone,
I want to have a comparison between two stations. The data are in .xls format. One of the column related to s4 which s4>0.2 consider as a event. How can I compute the mean strength of s4. Could you please help me regarding this?
Thank you in advance!

4 Comments

Is the mean to be calculated per-event, or over all samples that are within events, or over all samples with the ones that are not part of events set to effective s4 of 0, or ... ?
Ara
Ara on 22 Mar 2013
Thank you Walter for your attention. Actually, I want to see the occurrence of the event (only s4 >0.2 are important) first during one day and then extend it to one month. In this way I can have a plot that will present the strength of event at each station. Meaning that for ex. during March at L station we observed weak(s4>0.2), moderate(s4>0.3) or strong(s4>0.4)while at B station we observed only weak events. So I want to show it as a mean.
A mean over what period? A mean over the entire week will not tell you about number of strong events, as a mix of many short strong events and a few long weak events could still come out in the weak range.
You still need to be specific about what mean is being calculated. Is it the mean number of events? The mean number of events of each type? The mean strength during an event?
Ara
Ara on 22 Mar 2013
Edited: Ara on 23 Mar 2013
I want to plot "mean strength during an event".

Sign in to comment.

Answers (1)

Tobias
Tobias on 22 Mar 2013
You can specify rows and columns to be calculated for all Matlab built-in functions. You said your data is called s4, lets say I want the mean value of the 3rd column in s4:
mean(s4(:,3))
The syntax is (rows,columns), so my previously written code would be: (all rows, 3rd column)
(1:4, 3) would be the rows 1 to 4 in column 3
That way you can manipulate which data you want to do calculations upon, which enables you to calculate the three types of mean values you and Walter talked about.

1 Comment

Ara
Ara on 22 Mar 2013
Thank you to describe me. But, s4 in the name of my column and I only work with column data. In this column some values are greater than 0.2 so that was why I said mean strength during this event. It means I want to know about the mean of s4 during one day or even one month. As Walter said, events will be mixed together. Also another column of my data is related to time but I do not know how to match these together to get mean of the event?

Sign in to comment.

Asked:

Ara
on 22 Mar 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!