function plotf(pf, fs) % plotf(pf, fs) Plot function for probability and cumulative functions. % The optional format string fs is passed to the MATLAB plot functions. if nargin==1 fs='-'; end if ispf(pf)==1 x=xvals(pf); p=pvals(pf); if isdiscrt(pf)==1 stem(x,p,fs); else plot(x,p,fs); end elseif iscf(pf)==1 x=xvals(pf); p=pvals(pf); if isdiscrt(pf)==1 i=length(x); x=[x(1)-(x(2)-x(1)) x x(i)+(x(i)-x(i-1))]; p=[0 p 1]; stairs(x,p,fs); else plot(x,p,fs); end else error('not a valid probability or cumulative function') end