Sum of a signal in simulink
49 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Sam136
el 4 de Ag. de 2015
Editada: Yeow Yu Leong
el 9 de Jun. de 2024
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 comentarios
Respuesta aceptada
Azzi Abdelmalek
el 4 de Ag. de 2015
Editada: Azzi Abdelmalek
el 4 de Ag. de 2015
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 comentario
Yeow Yu Leong
el 9 de Jun. de 2024
Editada: Yeow Yu Leong
el 9 de Jun. de 2024
or use an accumulator
Más respuestas (1)
Sean de Wolski
el 4 de Ag. de 2015
You could also use a unit delay:
1 comentario
Azzi Abdelmalek
el 4 de Ag. de 2015
He is asking for all previous values. This will calculate out(n)+out(n-1)
Ver también
Categorías
Más información sobre General Applications en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!