How to get the mean value?

5 次查看(过去 30 天)
Ara
Ara 2013-3-22
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 个评论
Walter Roberson
Walter Roberson 2013-3-22
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 2013-3-22
编辑:Ara 2013-3-23
I want to plot "mean strength during an event".

请先登录,再进行评论。

回答(1 个)

Tobias
Tobias 2013-3-22
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 个评论
Ara
Ara 2013-3-22
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?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Line Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by