annotate general/numerical/rectify.m @ 4:e44f49929e56

Adding reorganised general toolbox, now in several subdirectories.
author samer
date Sat, 12 Jan 2013 19:21:22 +0000
parents
children
rev   line source
samer@4 1 function y=rectify(x)
samer@4 2 % rectify - 'half wave' rectification, rectify(x) x>0 ? x : 0
samer@4 3 %
samer@4 4 % rectify :: [Size->real] -> [Size->nonneg].
samer@4 5
samer@4 6 y = (x>0) .* x;
samer@4 7 % alternative implementation?
samer@4 8 % i=(x<0); y=x; y(i)=0;