%% Find Sign Function
% Find the sign function of a number.

sign(2)

%
% Find the sign function of the values of a vector.

V = [-11 0 1.5 Inf NaN];
sign(V)

%
% Find the sign function of the values of a matrix.

M = magic(3) - 5;
sign(M)

%
% Find the sign function of a complex number.

z = 4 - 3*i;
sign(z)

% Copyright 2015 The MathWorks, Inc.