% Written by Min-Hua Huang
% June 9, 2011
% Figure 3 of "Indefinite Integration of the Gamma Integral".
% Functional Plots of ${\exp(-x)}$ and $h_{-1}^{x}$ by varying $t$.
clear; clc; format long;
p=-1; q=0.01; r=1; row=(r-p)/q+1; 
record=ones(row,6)*-999; record(:,1)=p:q:r; kkk=row+1;
for c=-0.011:0.00005:0.011
    record(kkk,1)=c;
    kkk=kkk+1;
end
record(:,2)=exp(-record(:,1)); kk=3;
for j=2:1:5
    kkk=1;
    n=10^j;
    for c=p:q:r
        record(kkk,kk)=h(-1,c,n);
        kkk=kkk+1;
    end
    for c=-0.011:0.00005:0.011
        record(kkk,kk)=h(-1,c,n);
        kkk=kkk+1;
    end   
fprintf('Plotting the curve of h(-1,x) with t=10^%1i\n',j);
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);
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,'--k','LineWidth',2)
hold off
axis([-1, 1, -5, 40]);
box off;
xlabel('x');
ylabel('values of exp(-x) and h(s,x)')
legend('exp(-x)','h(-1,x,10^2)','h(-1,x,10^3)','h(-1,x,10^4)','h(-1,x,10^5)');