%-------------------------------------------------------------------------------------- % Matlab program used to generate Fig.1 %-------------------------------------------------------------------------------------- % This program was written in May 2006 by Stan Sykora while writing % the note on 'Exponential Transforms of Polygonal Functions', % published online at www.ebyte.it\library\educards\math\ExpIntegralTransforms.html. % The program is an attachment to the said article. %-------------------------------------------------------------------------------------- % The AUTHOR hereby authorizes EVERYBODY to copy, distribute, cut, or modify % the program in whichever form and by whatever means. If you use it and obtain % interesting results, however, you should cite the Web article. % % The AUTOR DISCLAIMS any LIABILITIES which any misguided soul might claim, % due to whatever he/she has done with the program or just thinks to have done. clear;clc;clf;echo off; n = 1000; x = linspace(-5,5,n); one = linspace(1,1,n); zer = linspace(0,0,n); ifreal = 0; if ifreal etap = (exp(-x)-1+x)./x./x; etam = (exp(x)-1-x)./x./x; eta2 = (exp(x)+exp(-x)-2)./x./x; plot(x,etap,'-k','LineWidth',2,'Color',[0,0,0.5]); hold on; plot(x,etam,'-k','LineWidth',2,'Color',[0,0,0.5]); hold on; plot(x,eta2,'-k','LineWidth',2,'Color',[0,0,0]); hold on; plot(x,one,'-k','LineWidth',1,'Color',[0,0,0]); hold on; else etap = ((1-cos(x))+i*(sin(x)-x))./x./x; etam = ((1-cos(x))-i*(sin(x)-x))./x./x; eta2 = 2*(1-cos(x))./x./x; plot(x,real(etap),'-k','LineWidth',2,'Color',[0.5,0,0]); hold on; plot(x,imag(etap),'-k','LineWidth',2,'Color',[0,0.5,0]); hold on; plot(x,imag(etam),'-k','LineWidth',1,'Color',[0,0.5,0]); hold on; plot(x,real(eta2),'-k','LineWidth',2,'Color',[0,0,0.5]); hold on; plot(x,zer,'-k','LineWidth',1,'Color',[0,0,0]); hold on; end set(gcf,'Color','white'); set(gca,'FontSize',20); set(gca,'LineWidth',2); set(gca,'TickLength',[.02,.02]); %axis([-15 15 -0.35 1.05]); axis([-5 5 -0.35 1.05]); %set(gca,'xTick',[-4,-2,0,2,4]);