max函数无法比较s​ym符号运算的大小,​尽管已设置为正数。

这是测试代码:
>> a=sym('a','positive');
>> b=sym('b','positive');
>> max(a,a+b)
ans =
max([a, a + b], [], 2, 'omitnan', false)
请教,该怎么解决这个问题呢?虽然从数学上可能确实无法比较。

 Réponse acceptée

javafon yuensr
javafon yuensr le 30 Mar 2023

0 votes

syms a b positive;
isAlways( a + b > a )
另外,数学上比较两个数值的大小,一般常用的是比较差是否大于零或商是否大于1

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB dans Centre d'aide et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by