Integration in Simulink- output not as desired

1 次查看(过去 30 天)
Dear Sir/Madam,
I know this is fairly simply, am trying to achieve something as below to be implemented in Simulink:
i want the following:
out(i) = out(i-1) + abs(signal(i-1) - signal(i))*(time(i)-time(i-1));
This is what I have tried, I have no idea what went wrong.
I used the integrator block in the Matlab. But, the output I got is:
out(i) = signal(i)*(time(i)-time(i-1));
I understand that my signal and time will be in discrete rather than analog.
Appreciate any suggestion, thanks
  1 个评论
want2know
want2know 2013-10-31
Dear Sir I have tried using the Unit Delay Blocks but still it didn't give the expected result. Where the inputs to Unit Delay Blocks are [0 1 2 3] for time and [5 5.1 5.2 5.2] for signal time signal(desired output in bracket) 0.0 20 (20) 1.0 5 (20.1) 2.0 5.1000 (20.2) 3.0 5.2000 (20.2) Please see the image for better view: http://imgur.com/OpipALP

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by