Limit of symbolic expression in MATLAB
Limits are functions used in calculus, appearing in the definitions of continuity, derivatives, and integrals. The limit of a symbolic expression is defined as the behavior of the symbolic expression at a particular point.
Suppose As x approaches to infinity (1/x) becomes 0.
Matlab allows users to calculate the limit of a symbolic expression using limit() method. Different syntax of limit() method
- limit(f,var,a)
- limit(f,a)
- limit(f)
- limit(f,var,a,’left’)
- limit(f,var,a,’right’)
limit(f,var,a)
- It returns the limit of function f when var approaches to a.
Example:
Matlab
syms x
f = cos(x)/x;
disp( 'f(x) :' );
disp(f);
l = limit(f,x,Inf);
disp( "Limit (x->Inf): " );
disp(l);
|
Output :
limit(f,a)
It returns the limit of function f when the default variable approaches to a.
Example:
Matlab
syms x
f = x^x;
disp( 'f(x) :' );
disp(f);
l = limit(f,0);
disp( "Limit (x->0): " );
disp(l);
|
Output:
limit(f)
It returns the limit of function f when the default variable approaches 0.
Example:
Matlab
syms x
f = tan(x)/x;
disp( 'f(x) :' );
disp(f);
l = limit(f);
disp( "Limit (x->0): " );
disp(l);
|
Output :
limit(f,var,a,’left’)
- It returns the left limit of function f when the var approaches a.
Example:
Matlab
syms x
f = 1/(2*x);
disp( 'f(x) :' );
disp(f);
l = limit(f,x,0, 'left' );
disp( "Left limit: " );
disp(l);
|
Output :
limit(f,var,a,’right’)
- It returns the right limit of function f when the var approaches a
Example:
Matlab
syms x
f = 1/(2*x);
disp( 'f(x) :' );
disp(f);
l = limit(f,x,0, 'right' );
disp( "Right limit: " );
disp(l);
|
Output :
Last Updated :
28 Jun, 2021
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...