%BREAKPOINT 判断函数在某点处的间断点类型
syms x
X0=3; %指定的点
FL=x^2; %X<X0时的函数表达式
FXO=10; %X=X0时的函数表达式
FR=log(x-3); %X>X0时的函数表达式
fx0_left=limit(FL,'x',X0,'left');
fx0_right=limit(FR,'x',X0,'right');
tf=1;
if isempty(FXO)
tf=0;
else
if isnan(fx0_left) || isnan(fx0_right) ||... % 极限不存在
isinf(double(fx0_left)) || isinf(double(fx0_right))
tf=0;
else % 极限存在
fx0=subs(FXO,'x',X0);
if ~isequal(fx0,fx0_left) || ~isequal(fx0,fx0_right)
tf=0;
end
end
end
if tf==0
if isinf(double(fx0_left)) || isinf(double(fx0_right)) % 左或右极限是否为无穷大
str='无穷间断点';
elseif isequal(fx0_left,fx0_right) % 判断左右极限是否相等
str='可去间断点';
elseif isnan(fx0_left) || isnan(fx0_right) % 判断左极限或右极限是否存在
str='振荡间断点';
else
str='跳跃间断点';
end
else
str='函数在该点连续.';
end %str:间断点类型字符串,STR可以为'无穷间断点'、'可去间断点'、'振荡间断点'、'跳跃间断点'和'函数在该点连续.'五种情形之一
str %输出间断点类型
请将具体不明白的地方指出来,这样直接放代码相帮也帮不上你。