function bez_ap(f,n)

% BEZ_AP : Bernstein approximation
% bez_ap(f,n)
% plots n-th degree Bernstein approximation to f 

c = f([0:n]/n)';
t = linspace(0,1)';
p = bez_pol(n,t)*c;
ft = f(t);
plot(t,[p, ft]);

