function points=fnplt(f,symbol,interv)
% FNPLT	Evaluate and plot a spline or pp.
%
%     [points=] fnplt(f[,symbol[,interv]])
%
%  plots the given function  f  (between its extreme breaks by default,
%  else on the optionally specified interval  interv ),
%  using the  symbol  (optionally) specified . 
%  Also returns the plotted points in  points=[x;v]  or  v([1:2],:) .

% C. de Boor / latest change: Feb.25, 1989
% C. de Boor / latest change: December 1, 1990 (add interval specification)
% Copyright (c) 1990-92 by Carl de Boor and The MathWorks, Inc.

if (f(1)==11), f=sp2pp(f);end
if (nargin>=3), f = ppcut(f,interv); end

[breaks,coefs,l,k,d]=ppbrk(f);
npoints=100;
x=breaks(1)+[0:npoints]*((breaks(l+1)-breaks(1))/npoints);
v=ppual(f,x);

if (nargin==1), symbol='-';end
if (d==1), plot(x,v,symbol);points=[x;v];
else,plot(v(1,:),v(2,:),symbol);points=v([1,2],:);
end
drawnow
