function simpleplot(a,b,n) % This is a simple Matlab routine to plot a function % on the interval [a,b] using n uniformly spaced % points. To change the function, modify the code % at the indicated place %begin by defining the arrays hold the funtion information delta = (b-a)/n; % define the sample points. The first and last points align with a and b. for i = 1: n+1 x(i) = a+ delta*(i-1); %change the function here y(i)=x(i)*sin(3*x(i)); end %Now call the built-in Matlab plotting function plot(x,y) graphof=strcat('Graph of f(x)'); title(graphof) xlabel('x')