Sliding window on Simulink
3 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Array and Matrix Mathematics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!