trapezoid_rule accepts a function of a single variable, a 1x2 vector which defines the limits of integration and the number of points that are used in the approximation.
The output contains the approximation and the figure showing the method.
The function is used only for visualization purposes as trapz is already built-in.
Update: Needs Symbolic math toolbox, not simulink.
Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.