MATLAB: Definite Integrals in Simulink with a = last time step, b = current time step

definite integralsimulinktime step

I need to put this equation in my Simulink model:
A = B*(tn-tn1) where tn = current time, and tn-1 = last time step.
I think it would be easy if the time step was known and constant, but if I wanted to use variable time step, I am not sure how I would do this in Simulink. Would I need to do some sort of a definite integral using a = last time step, and b = current time step?
I would think that there is a much easier way.
Thanks in advance!
Vicky

Best Answer