%% Use Assumptions on Symbolic Variables
% heaviside takes into account assumptions on variables.
% Create a symbolic variable x and assume that it is less than 0.

syms x
assume(x < 0)

% Evaluate the Heaviside step function for the symbolic input x.

H = heaviside(x)

% For further computations, clear the assumptions on x by recreating it using syms.

syms x

%
% Copyright 2006-2019 The MathWorks, Inc.