use of different time windows and time shift
3 次查看(过去 30 天)
显示 更早的评论
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)
0 个评论
采纳的回答
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
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.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Dates and Time 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!