Suppose to have these data
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1232407/image.png)
The simulink model is calulating
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1232422/image.png)
you can calulate the integral in the discrete form with cumtrapz
% data
t = linspace(0,1,20).';
x = 2*t;
y = t.^2;
c = 3;
% function to integrate
dz = c*(x-y);
% function z
z = cumtrapz(t,dz);
% plot
figure,hold on
plot(t,z,'LineWidth',2)
% check
plot(t,3*t.^2-t.^3,'--','LineWidth',2)