// Lab2.txt function foo = f(t) foo = 5*t + (sin(9*t-5)/t); endfunction start = input("Enter a number for the start value.\n"); stop = input("Enter a number for the stop value.\n"); steps = input("Enter a number for the step value.\n"); delta_t = (stop - start) / steps; total = 0; for i=0:(steps-1), t = start + i*delta_t; total = total + f(t); end total = total * delta_t; printf("Rectangular integration value %f.\n",total);