symbolic variable - proving positive

4 views (last 30 days)
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.

Accepted Answer

Walter Roberson
Walter Roberson on 30 Jun 2017
Edited: Walter Roberson on 30 Jun 2017
syms a positive
if isAlways(a>0); disp('OK'); else disp('KO'); end

More Answers (0)

Community Treasure Hunt

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

Start Hunting!