clear all; close all;
%------------------- demo_funz_leb.m ---------------------------
% This script plots the Lebesgue function of F-H's interpolant at
% 30 quasi-equidistant nodes on [0,1].
%
% Functions called: weights, leb_function
%
%----------------------------------------------------------------
% Authors
% 
%      Stefano De Marchi and Cinzia Bandiziol
%      Department of Mathematics
%      University of Padova
%             
% Version: May 2015		
%----------------------------------------------------------------		

a=0; b=1; %endpoints

n=30;     %number of nodes
d=1;      %blending parameter

delta=1/(n+3); %perturbation
x=linspace(a,b,n)'; 
x(n/2)=x(n/2)-delta; % we perturb the ceontral point
%x(5)=x(5)+delta;

w=weights(d,x);

[lambda_n_fun,points]=leb_function(min(x),max(x),n,x,w);

plot(points,lambda_n_fun,'b-'); grid
title('Lebesgue function at quasi equidistant points');
axis tight