function out = unit(t) % This function is the unit step: % % sig = unit(t), where SIG and T are vectors of the same dimension. % % elements of out are either 0 or 1 corresponding to elements of T % being negative or non-negative, respectively. % % % written by Kevin D. Donohue 2/93 % out = zeros(size(t)); % Initialize output array to zeros elm_1 = find(t >= 0); % Find positive values on t-axis out(elm_1) = ones(size(elm_1));