![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1709971/image.png)
Cummulative Summing in Simulink
8 次查看(过去 30 天)
显示 更早的评论
Hello community.
I am trying to do cumulative summing in Simulink, which I beleive creates a a loop. Can anyone
recommend how I accomplish it?
input signal ---> SUM BLOCK ----> output
0.2 0.2
0.3 0.5
0.1 0.6
0.5 1.1
0.7 ---> SUM BLOCK ---> 1.8
0.8 2.6
0.3 2.9
0.6 3.5
any feedback will be highly appreciated
0 个评论
采纳的回答
Andres Adam
2024-6-5
Hi A-Rod, you are right: we usually need a loop in this situation. A cumulative sum is usually done with a "memory" block like this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1709971/image.png)
I am using the 8 values you provided as an example.
I have seen other solutions such as using a "unit delay" block, integrator blocks, and the dedicated "Cumulative sum" block from the DSP System Toolbox.
I recommend paying attention to the time. When should the cumulative sum be performed? I changed my solver settings to take discrete steps at 1 second. Be careful to not run into issues where you are summing the same value more than once.
更多回答(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!