필터 지우기
필터 지우기

Unsure of which block to use in simulink to keep running total.

조회 수: 3 (최근 30일)
Roger
Roger 2011년 5월 24일
댓글: chizom wornu 2021년 5월 19일
I am building a model in simulink and need to keep a running total of a variable. i.e. if at each time step the value going into the block is 1 3 0 5 then I want the output to be 1 4 4 9. I am unsure if the "sum of elements" block can do this or if I need a "cumulative sum" block from the DSP system toolbox. Any help would be great and if I have missed any important information then I would be happy to clarify.
Roger

채택된 답변

Arnaud Miege
Arnaud Miege 2011년 5월 24일
If you are using a fixed-step discrete solver, then probably a Discrete-Time Integrator block should do the trick. If you are using a variable-step continuous solver, and your variable varies continuously with time (as opposed to discretely), then an Integrator block is more appropriate.
HTH,
Arnaud
  댓글 수: 3
shiva deep
shiva deep 2017년 2월 19일
This certainly helped me also. Thank you
chizom wornu
chizom wornu 2021년 5월 19일
Please how do you implent the cumulative sum with an integrator

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Signal Attributes and Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by