In Mathematica, standard functions like Sign[x] or Log[x] thread, so that Sign[{1,-2},{0,5}] = [{1,-1},{0,1}]. I want a simple function that works like Sign[x], except that it returns 1 with a 0 input and 0 for negative inputs. Here's my function.
Sn[x_] := If[x<0,0,1]
I want
Sn[{1,-2},{0,5}]
[{1,0},{1,1}]
I get
Sn[{1,-2},{0,5}]
If[{1,0},{1,1}<0,0,1]
I tried playing with Thread and Map, but nothing works. Can someone help? Thanks.