What's the most simple way to make all negative elements of a matrix to 0 in DolphinDB database?

24 views Asked by At

For this specific question, I use (x+abs(x))\2. But is there a more straightforward and more general way to do this?

1

There are 1 answers

2
Davis Zhou On
a=reshape(-5 .. 4, 5:2)
each(x->iif(x<0, 0, x), a)