use of different time windows and time shift

5 ビュー (過去 30 日間)
aa
aa 2020 年 8 月 15 日
コメント済み: aa 2020 年 8 月 15 日
Hi All,
I have a problem in implementaion of for loop.
I have data in two coloumn: (a) Number of hours (b) parameter variation
I want to see teh change of paramter for diffrent time windows and diffrent time shifts and then use the output in an equation For exmaple, at first stage i want to calcualte paramter for 1 hour time window with a shift of 1 hour. then two hour time window with a shift of 1 hour, so on and so far.
then i want to calculate change in 4 hour with a time shift of 2 hour or three hours or 4 hours and so on ...
b=((u-(r).*(dt)./std
here u is the sum of enetires in each time window, r is a fix value say 0.33 ... dt is the length of tim window (2 hours or 3 or 4) and std is also fixed value say 0.5
I have to calculate the value of b for different timw windows and diffrent time shifts. (a raw data attached)

採用された回答

Walter Roberson
Walter Roberson 2020 年 8 月 15 日
c = cumsum([0,data]) ;
Then for window dt with shift s
(c(dt+1:s:end) - c(1:s:end-dt)). * dt .* (r/std)
does all the slots at the same time.
  3 件のコメント
Walter Roberson
Walter Roberson 2020 年 8 月 15 日
cell array. Your different dt and different shift are going to result in different sizes of outputs, so use a cell array to store them.
You would probably not write the results to a file because of the different sizes of results.
I do not know what you are going to do with the results that could be meaningful with the different array sizes.
aa
aa 2020 年 8 月 15 日
i am trying to work on the code you proposed but it did not work. May you please used the field i attached here and the calculate the outpout.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDates and Time についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by