I have this code in which I use the integration with the midpoint method (with rectangles), I already have the formulas but I don't know how to plot it.
expression = input ("Please enter the expression: ", 's');
a = input ("Enter value of a: ");
b = input ("Enter value of b: ");
m = input ("Enter value of m: ");
S = S + (h) * (f((a+(a+h))/2));
fprintf ("The approximate value of the integral of% s is:% 7.4f \ n", expression, S);