Saturday, 4 June 2016

Calculus using MATLAB 2 - finding the limits (2)

The limit function falls in the realm of symbolic computing; you need to use the syms function to tell MATLAB which symbolic variables you are using. You can also compute limit of a function, as the variable tends to some number other than zero.

 To calculate lim x->a(f(x)), we use the limit command with arguments. The first being the expression and the second is the number, that x approaches, here it is a.

For example, let us calculate limit of a function f(x) = (x-3)/(x-1), as x tends to 1.

limit((x - 3)/(x-1),1)

MATLAB will execute the above statement and return the following result:

ans = NaN




No comments:

Post a Comment