0

I try with these commands

x = sym('x');
f(x) = sym('f(x)');
f(x) = x/x;

and

f(x) = sym('x/x');

, but both of them produce

f(x) = 1

(yes.. for every real x including 0)

The question is how I can avoid the pre-evaluation in the command "sym", or there exists another way to handle this problem.

Thank you very much!

update 21.05.2014:

Let me describe the problem a little bit.

Consider

f(x) = x/x

and

g(x) = 1

It is obvious that domains of f and g are R-{0} and R respectively.

The automatic simplification in sym/syms may lead to lose some info.

4

2 に答える 2

1

コードに事前評価はありません。F(x) = x/x は常に 1 です。x = 0 の場合でも、Matlab は関数の表現方法を単純化していますが、pe 評価はありません。

x = 0、x/x = 1 の理由を理解するには、不定形を調べる必要があると思います

于 2014-05-20T14:55:45.723 に答える