Sei sulla pagina 1di 1

Exponential Function Program/Script

The following is a program/script (Listing 1) that produces results of a power series for the function f (t ) = e at where a = -1. The result is a graph that should look similar to Figure 1

Figure 1 Exponential Power Series Graph from MATLAB

It is suggested that you cut the following program/script and paste into an m-file. Then run the program/script and observe the output. % MATLAB program for exponential function a=-1; t=0:0.01:10; f=ones(size(t)); for n=1:100, f=f+((a*t).^n)/factorial(n); plot(t,f) hold on end grid axis([0 10 0 1.2]) hold off
Listing 1 Exponential Power Series MATLAB Program/Script

Potrebbero piacerti anche