符号类型否定怎么办?

2 views (last 30 days)
Walter Roberson
Walter Roberson on 12 Jul 2021
Commented: Walter Roberson on 12 Jul 2021
一个人如何做符号类型 否定 ?(允许的高级方法!!)
For example
symsx n m
y = symsum(1/(x-n),n,1,m)
y =
Notice the -- that is, if x is an integer. That leads to the question: how can you set an assumption such that x is known to be a non -integer ?
您可以使用假设()将x设置为整数,但是假设()不支持否定。万博1manbetx对我来说,内部穆巴德的例行事件并不明显 assume does either; you can read the code for it by using
regexprep(char(evalin(symengine, 'expose(assume)')),'\\n','\n')
You can appear to construct an appropriate type at the MuPAD level:
S1 = evalin(symengine,'Dom::Real and not Dom::Integer')
S1 =
S2 = evalin(symengine,'~(x in integer)')
S2 =
but how could you associate that type with a symbolic variable?
I know that in this particular case you could use children() to extract the third branch of the piecewise() and proceed from there, skipping around the problem: but what if you wanted MATLAB to be able to reason about the fact that a variable is a non-integer ?

Accepted Answer

Paul
Paul on 12 Jul 2021
Accoding to the doc page for assume(), maybe
assume(~in(x,'整数'))
will do what you want? I couldn't test it because my version (2019a) only returns
psi(1 - x) - psi(m - x + 1)
as the ouput of that symsum, without any conditions.

More Answers (0)

s manbetx 845


发布

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

开始狩猎!