On Sun, 4 Nov 2012, Pindar wrote:
matrix mtestm = (ytestm.>0) ? 10 : 2 #this works not
Yes, it is guaranteed by hansl syntax that it "works not".
The condition behind the "?" operator is not a boolean yes/no
condition, as it must be in context -- unless "ytestm" happens to be
the name of a 1 x 1 matrix. As I explained not so long ago on this
list, ".>0" is an element-wise operator which returns a matrix
result. And In hansl a matrix cannot serve as a boolean condition.
In principle one could interpret the above statement as "create a
matrix mtestm of the same dimensions as ytestm, such that element
(i,j) of mtestm is 10 or 2 as element (i,j) of ytestm is positive or
not" but at present hansl does not implement that sort of statement,
nor does it claim to.
Allin Cottrell