% Written by Min-Hua Huang
% June 9, 2011
% Figure 4 of "Indefinite Integration of the Gamma Integral".
% Functional Plots of ${\exp(-x)}$ and $h_{s}^{x}$ with three significant 
% digits (if $s\in {{\mathbb{Z}}^{-}}$).
clear; clc; format long; 
p=-10; q=0.1; r=15; row=(r-p)/q+1; 
record=ones(row,7)*-999; record(:,1)=p:q:r; kkk=row+1;
fprintf('Plotting the curves of h(s,x) from s=-3 to 1 (t=10^4).\n');
for c=-1.1*10^-1:2*10^-3:1.1*10^-1
    record(kkk,1)=c;
    kkk=kkk+1;    
end
for c=-1.1*10^-3:2*10^-5:1.1*10^-3
    record(kkk,1)=c; 
    kkk=kkk+1;    
end   
for c=-1.1*10^-5:2*10^-7:1.1*10^-5
    record(kkk,1)=c; 
    kkk=kkk+1;    
end  
for c=-1.1*10^-7:2*10^-9:1.1*10^-7
    record(kkk,1)=c; 
    kkk=kkk+1;    
end  
for c=-1.1*10^-9:2*10^-11:1.1*10^-9
    record(kkk,1)=c; 
    kkk=kkk+1;    
end  
record(:,2)=exp(-record(:,1)); kk=3; 
%***************************** h(0:1,c,0) *******************************
for i=1:-1:0
    kkk=1;
    for c=p:q:r
        record(kkk,kk)=h(i,c,10^4);
        kkk=kkk+1;
    end
    for c=-1.1*10^-1:2*10^-3:1.1*10^-1
        record(kkk,kk)=h(i,c,10^4);
        kkk=kkk+1;    
    end
    for c=-1.1*10^-3:2*10^-5:1.1*10^-3
        record(kkk,kk)=h(i,c,10^4); 
        kkk=kkk+1;    
    end    
    for c=-1.1*10^-5:2*10^-7:1.1*10^-5
        record(kkk,kk)=h(i,c,10^4); 
        kkk=kkk+1;    
    end   
    for c=-1.1*10^-7:2*10^-9:1.1*10^-7
        record(kkk,kk)=h(i,c,10^4); 
        kkk=kkk+1;    
    end  
    for c=-1.1*10^-9:2*10^-11:1.1*10^-9
        record(kkk,kk)=h(i,c,10^4); 
        kkk=kkk+1;    
    end
    kk=kk+1;
end   
%****************************** h(-1:-3,c,0) ****************************
for i=-1:-1:-3
    kkk=1;
    for c=p:q:r
    record(kkk,kk)=h(i,c,10^4);
    kkk=kkk+1;
    end
    for c=-1.1*10^-1:2*10^-3:1.1*10^-1
        record(kkk,kk)=h(i,c,10^4); 
        kkk=kkk+1;    
    end
    for c=-1.1*10^-3:2*10^-5:1.1*10^-3
        record(kkk,kk)=h(i,c,10^4); 
        kkk=kkk+1;    
    end    
    for c=-1.1*10^-5:2*10^-7:1.1*10^-5
        record(kkk,kk)=h(i,c,10^4); 
        kkk=kkk+1;    
    end    
    for c=-1.1*10^-7:2*10^-9:1.1*10^-7
        record(kkk,kk)=h(i,c,10^4); 
        kkk=kkk+1;    
    end  
    for c=-1.1*10^-9:2*10^-11:1.1*10^-9
        record(kkk,kk)=h(i,c,10^4); 
        kkk=kkk+1;    
    end      
kk=kk+1;    
end
B=sortrows(record,1);
x=B(:,1);
y1=B(:,2);
y2=B(:,3);
y3=B(:,4);
y4=B(:,5);
y5=B(:,6);
y6=B(:,7);
plot(x,y1,'-k','LineWidth',2)
hold on
plot(x,y2,'-k+','MarkerSize',2)
plot(x,y3,':k','LineWidth',2)
plot(x,y4,'-.k','LineWidth',2)
plot(x,y5,'-ks','MarkerSize',2)
plot(x,y6,'--k','LineWidth',2)
hold off
y=B(:,2:7);
axis([-10, 15, -30, 30]);
box off;
xlabel('x');
ylabel('values of exp(-x) and h(s,x)')
legend('exp(-x)','h(1,x)','h(0,x)','h(-1,x)','h(-2,x)','h(-3,x)');