gusucode.com > 《精通matlab 7》包括配套光盘 > 配套光盘里的程序附件/Ex-30/testclass/@polynom/plot.m

    function plot(p)
% POLYNOM/PLOT  PLOT(p) plots the polynom p.
r = max(abs(roots(p)));
x = (-1.1:0.01:1.1)*r;
y = polyval(p,x);
plot(x,y);
title(char(p))
grid on