8-hr moving/running averages in SImulink

3 views (last 30 days)
Christopher
Christopher on 12 Mar 2013
Hey guys,
I'm trying to calculate the running/moving average over a fixed time period for a variable in Simulink. However, I am having difficulties in implementing a solution.
I am calculating the variable '_x_' using the ode45 solver at variable-steps. At each time-step, for t>8, I want to calculate the average of '_x_' over the period '_t-8 to t_'. I tried using the integrator block with reset, however, due to the reset, the results are inconsistent. I also checked out the "Windowed Integrator" block however that is dependent on a predetermined number of samples so I can't use it since i'm using variable step.

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!