symbolic variable - proving positive

2 次查看(过去 30 天)
Hi everyone. How can I prove that a symbolic variable is positive? It is not possible to use if statement for symbolic variables.
close all
clear all
a=sym('a','positive');
if(a>0)
disp('OK')
else
disp('KO')
end
Thank you.

采纳的回答

Walter Roberson
Walter Roberson 2017-6-30
编辑:Walter Roberson 2017-6-30
syms a positive
if isAlways(a>0); disp('OK'); else disp('KO'); end

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Assumptions 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by