Sliding window on Simulink

4 views (last 30 days)
Juan Diego Rios Penaloza
Juan Diego Rios Penaloza on 15 Jan 2020
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.

Answers (0)

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!