%% Ignore Assumptions on Variables
% The sym and syms functions let you set assumptions for symbolic variables.
% Assume that the variable x is positive.

syms x positive

% When you solve an equation for a variable under assumptions, the solver only returns solutions consistent with the assumptions. Solve this equation for x.

eqn = x^2 + 5*x - 6 == 0;
S = solve(eqn,x)

% Allow solutions that do not satisfy the assumptions by setting 'IgnoreProperties' to true.

S = solve(eqn,x,'IgnoreProperties',true)

% For further computations, clear the assumption that you set on the variable x by recreating it using syms.

syms x

%
% Copyright 2006-2019 The MathWorks, Inc.