Documentation |
Show assumptions set on symbolic variable
Show the assumptions set on variables n and x separately, and then show assumptions set on all variables.
Assume that the variable n is integer and the variable x is rational. In addition to that , assume that the product n*x belongs to the interval from -100 to 100:
syms n x assume(n,'integer') assume(x,'rational') assumeAlso(-100 <= n*x <= 100)
To see the assumptions set on the variable n, enter:
assumptions(n)
ans = [ -100 <= n*x, n*x <= 100, in(n, 'integer')]
The syntax in(n, 'integer') indicates n is an integer.
To see the assumptions set on the variable x, enter:
assumptions(x)
ans = [ -100 <= n*x, n*x <= 100, in(x, 'rational')]
To see the assumptions set on all variables, use assumptions without any arguments:
assumptions
ans = [ -100 <= n*x, n*x <= 100, in(n, 'integer'), in(x, 'rational')]
For further computations, clear the assumptions:
syms n x clear
Show the assumptions set by using syms and assume.
Use assumptions to return all assumptions, including those set by the syms command:
syms x real assumeAlso(x < 0) assumptions(x)
ans = [ x < 0, in(x, 'real')]
The syntax in(x, 'real') indicates x is real.