
function esercizio4


fprintf('\n \t COSTANTI DI LEBESGUE, NODI EQUISPAZIATI');

max_deg=50;

for deg=1:max_deg
    x=linspace(-1,1,deg+1);
    [L,Lconst]=lebesgue(x); 
    lebesgue_constants(deg)=Lconst;
    low_est=2^(deg-2)/(deg^2);
    high_est=2^(deg+3)/deg;
    asy_est=2^(deg+1)/(exp(1)*deg*log(deg));
    fprintf('\n \t DEG: %3.0f LEBESGUE CONST.: %1.4e [%1.1e,%1.1e] ASY: %1.1e',...
        deg,Lconst,low_est,high_est,asy_est);
end

plot(1:max_deg,lebesgue_constants,'ro-');
fprintf('\n \n');

