Getting the scope to show sum of time series output with respect to time

Hi
I have a value that changes with respect to time due to arithmetic function. Instead of viewing the new output with respect to time, I would like to see the new output + sum of previous outputs with respect to time.
Please help me with this. I need to learn how to do this in simulink or if there is a block/function that I can use?

 採用された回答

Mischa Kim
Mischa Kim 2014 年 3 月 24 日

0 投票

James, you could use the Cumulative Sum block. It is included in the DSP System Toolbox.

4 件のコメント

James Murray
James Murray 2014 年 3 月 24 日
Thank you for the help.
I just tried this and got an error saying:
Error in 'Combined/Cumulative Sum': All sample times for this block must be discrete. Continuous sample time is not allowed.
Mischa Kim
Mischa Kim 2014 年 3 月 24 日
編集済み: Mischa Kim 2014 年 3 月 24 日
OK. Well for continuous systems you might as well use a simple integrator block (in Commonly Used Blocks). By double-clicking the block you can set the initial conditions (internal or external to the block) and implement a reset mechanism, e.g., to repeatedly start counting from zero after certain triggering events.
James Murray
James Murray 2014 年 3 月 24 日
Thank you so much that worked.
Brent van Versendaal
Brent van Versendaal 2017 年 10 月 1 日
Hi,
I have a similar problem. Mischa, can you please explain how I can implement such a mechanism so I will get the sum of all the values? It's a value that changes with respect to time: a sum of all the energie used by a radiator in a week.
regards, Brent

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by