Time-series data

14 ビュー (過去 30 日間)
George1990
George1990 2019 年 2 月 20 日
回答済み: Bob Thompson 2019 年 2 月 20 日
Hi everybody,
I have a set of time series data and I have to check if the average values are within the range for a certain amount of time (for example if the parameter X is in the range for 2 minutes).
Is there a matlab function that allows me to do that?
Thank you for your time!
  4 件のコメント
Bob Thompson
Bob Thompson 2019 年 2 月 20 日
Are you saying you want a series of mean values, similar to an RMS? Or are you looking for a running average?
George1990
George1990 2019 年 2 月 20 日
I want a series of mean value and check wether they are in range(fixed values) of not. How do you do that? thank you for your help

サインインしてコメントする。

採用された回答

Bob Thompson
Bob Thompson 2019 年 2 月 20 日
The 'simplest' way to do a series of mean values is to use a for loop with the mean function.
nmean = 50; % Number of values you would like to average at a time
for i = 1:2*length(data)/nmean
average(i) = mean(data((i-1)*nmean/2:(i-1)*nmean/2+nmean));
end
You may run into an issue with index exceeding matrix dimensions near the end of your data set. If this happens, just reduce the maximum i value by changing the bounds of the loop. If you are not sure how to do that look up the basics of a for loop here.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTime Series についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by