EBS101 - Math1 - MATLAB - Session 9 - Limits - 2024-2025
EBS101 - Math1 - MATLAB - Session 9 - Limits - 2024-2025
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).
2−√𝑡 2 +3
b. lim
𝑡→−1 𝑡+1
Solution:
Page 1 of 3
Pharos University in Alexandria
Faculty of Engineering 2024-2025
Department of Basic Sciences
𝑥
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.
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:
Page 2 of 3
Pharos University in Alexandria
Faculty of Engineering 2024-2025
Department of Basic Sciences
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).
Page 3 of 3