function y = dTriac(x, threshold) % dRelay - elements lower than threshold sets to zero % y = dRelay(x, threshold) % x - input array % threshold % y = abs(x), for x >= threshold % y = 0 , for x < threshold y = (abs(x) - threshold) .* (abs(x) > threshold) ; return