|
From: | Doug Stewart |
Subject: | Re: symbolic true |
Date: | Thu, 11 Jun 2015 06:24:08 -0400 |
Currently, you need `if (logical (b < a))`On 11/06/15 04:05, Doug Stewart wrote:
using this code:
clear
syms p a b
digits(47);
b=vpa("1.00000")
a=vpa("3.90000")
b<a
a<b
if ( b<a)
p="100"
else
p="400"
endif
After running this p should be 100 but it isn't.
The if statement always goes to the false condition!!
How can I make the if statement work with a
(sym) True
This is a bug in Octave: https://savannah.gnu.org/bugs/?43097
(also noted here: https://github.com/cbm755/octsympy/issues/191)
FWIW, the decision to have symbolic True/False values in Symbolic pkg could be revisited which would be a workaround. But I think I did that to avoid corner cases like
`[x true x]`.
Colin
[Prev in Thread] | Current Thread | [Next in Thread] |