Sliding window on Simulink

2 次查看(过去 30 天)
Juan Diego Rios Penaloza
Hello everybody.
I need to implement a sliding window in Simulink to obtain certain ammount of past data in a vectorial form. If we take as example the "Moving average" block in the sliding window mode, what I need is the vector of which the average is calculated.
In case you need more information, what I precisely need to do is the following. I have a (discrete) current of which I want to get the last 5 milliseconds at a certain precise instant of the simulation, when I get a pickup signal of an electrical protection. I need this current in Matlab while the simulation is running. By now, I'm doing so by reading the current (as input signal of an S-function) at each step time since the beginning of the simulation and I'm putting all the information in a vector. This is of course time-consuming. Instead of reading at each step time (the time step is 1e-6 s), I'd prefer to read just in one shot, the whole 5 last milliseconds current data (maybe in a vector or something) when the pickup signal gets activated.
I think there might be an easy way to do so.
Thank you.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Array and Matrix Mathematics 的更多信息

产品


版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by