0% found this document useful (0 votes)
7 views3 pages

EBS101 - Math1 - MATLAB - Session 9 - Limits - 2024-2025

Uploaded by

202402557
Copyright
© © All Rights Reserved
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)
7 views3 pages

EBS101 - Math1 - MATLAB - Session 9 - Limits - 2024-2025

Uploaded by

202402557
Copyright
© © All Rights Reserved
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
You are on page 1/ 3

Pharos University in Alexandria

Faculty of Engineering 2024-2025


Department of Basic Sciences

EBS 101 (Engineering Mathematics 1)

MATLAB _ Session 9_ Evaluating Limits

MATLAB Uses the Symbolic Math Toolbox software to evaluate the limits of functions directly.

The options of the corresponding syntax are shown in the following table, where f is a function of the
symbolic object x (in terms of the variable x).

Example 1:

Evaluate:
𝑥
a. lim
0 𝑥 2 +5𝑥

Solution: Note that the default case, limit(f) is the same as limit(f,x,0).

MATLAB commands Output In Command Window


syms x
limit(x/(x^2+5*x)) ans = 1/5

limit(x/(x^2+5*x),x,0) ans = 1/5

2−√𝑡 2 +3
b. lim
𝑡→−1 𝑡+1

Solution:

Syms t should be used first to define or construct the symbolic variable t

Page 1 of 3
Pharos University in Alexandria
Faculty of Engineering 2024-2025
Department of Basic Sciences

MATLAB commands Output In Command Window


syms t
limit((2-sqrt(t^2+3))/(t+1),t,-1) ans = 1/2

𝑥
c.lim
∞ 2𝑥−3

Solution:

MATLAB uses symbol inf to represent infinity .Calculations like n/0, where n is any nonzero real value,
result in inf.

MATLAB commands Output In Command Window


syms x
limit(x/(2*x-3),x,inf) ans = 1/2

limit(x/(2*x-3),inf) ans = 1/2

One-Sided Limits

Example (2): Plot the graph and evaluate the limit of x/|x|, as x approaches 0 from
the left and from the right.

Solution:

MATLAB commands Output Figure


fplot(@(x)x/abs(x))

Page 2 of 3
Pharos University in Alexandria
Faculty of Engineering 2024-2025
Department of Basic Sciences

➱Hint: abs(x) is the absolute value of the elements of x.

To calculate the limit as x approaches 0 from the left;

MATLAB commands Output In Command Window


syms x
limit(x/abs(x), x, 0, 'left') ans = -1

To calculate the limit as x approaches 0 from the right;

MATLAB commands Output In Command Window


syms x
limit(x/abs(x), x, 0, 'right') ans = 1

Since the limit from the left does not equal the limit from the right, the two- sided limit does not exist. In
the case of undefined limits, MATLAB returns NaN (not a number).

MATLAB commands Output In Command Window


syms x
limit(x/abs(x), x, 0) ans = NaN

© By Engineering Mathematics Group

Page 3 of 3

You might also like