we must do a project in matlab we must enter a function and the limits so that the integral is improper and returns the graph with the value of the area under the curve, the problem is that we can not generate the graph correctly, walking online I found this fraction of code that generates a very good graphic but we do not understand how it works, could someone explain the operation? I know that the fill function is the one that graphs but I do not understand how the parameters pass.
clear all x1 = -5: 0.1: 10; y1 = x1. ^ 2;
x2 = x1; y2 = y1 * 0;
x3 = ones (1, length (x1)) * x1 (end); y3 = y1;
x = [x2 x3 x1 (end: -1: 1)]; y = [y2 y3 y1 (end: -1: 1)]; fill (x, y, 'r')