% Matlab script to plot the function y = f(x) % where f(x) is a polynomial and the range and % coefficients of the polynomial are specified by the user. % Get the values from the user xrange = input('Enter the range of x values [a b]: '); coef = input('Enter the coeffients of y=Ax^3 + Bx^2 + Cx + D [A B C D]: '); % Create the points to plot xx = xrange(1):0.1:xrange(2); yy = polyval(coef,xx); % Plot the points plot(xx,yy);