8-hr moving/running averages in SImulink

2 次查看(过去 30 天)
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.

回答(0 个)

类别

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

Community Treasure Hunt

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

Start Hunting!

Translated by