Sum of a signal in simulink
49 次查看(过去 30 天)
显示 更早的评论
In my Simulink model, current value of a signal should be added to all previous value of the same signal. I've used integrator with initial value of zero to find it; however the result is different from what I find in Matlab through "sum" or "trapz" function. The solver is continuous with fixed step size. Any thought to resolve this issue. or any other block to use for this purpose instead of integrator?
0 个评论
采纳的回答
Azzi Abdelmalek
2015-8-4
编辑:Azzi Abdelmalek
2015-8-4
function y=fcn(u)
persistent a
if isempty(a)
a=0
end
y=u+a;
a=y;
You can also use a discrete transfer function 1/(z-1)
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 General Applications 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!