function foo = f(t) foo = (5 * t) + (sin(9 * t - 5 ) / t) endfunction //Get the intigration limints and step size mprintf("Enter the intigration start value \n"); [start_t]=mscanf("%f"); mprintf("Enter the intigration end value \n"); [end_t]=mscanf("%f"); mprintf("Enter the step size for intigration \n"); [steps]=mscanf("%f"); step_size = (end_t - start_t) / steps; t=start_t; // Loop for rectangular integration area = 0; // initialize area for i=0:(steps-1), area=area+f(t)*step_size; t=t+step_size; end mprintf("Rectangular integration value %f\n", area);