0% found this document useful (0 votes)
161 views1 page

MATLAB Exponential Series Script

The document provides a MATLAB program and script that calculates an exponential function as a power series for f(t) = e-at where a = -1. The program iterates through terms of the power series up to n=100, calculates each term, and plots the resulting graph against t from 0 to 10, which should resemble the sample graph in Figure 1 showing an exponential decay curve.

Uploaded by

yousufnet
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
161 views1 page

MATLAB Exponential Series Script

The document provides a MATLAB program and script that calculates an exponential function as a power series for f(t) = e-at where a = -1. The program iterates through terms of the power series up to n=100, calculates each term, and plots the resulting graph against t from 0 to 10, which should resemble the sample graph in Figure 1 showing an exponential decay curve.

Uploaded by

yousufnet
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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

You might also like