How do I create a symbolic integer in the Symbolic Math Toolbox?

20 Ansichten (letzte 30 Tage)
I would like to know how to create a symbolic variable in the Symbolic Toolbox such that it is assumed to take only integer values.

Akzeptierte Antwort

MathWorks Support Team
MathWorks Support Team am 21 Jun. 2012
If you are using the MuPad symbolic engine from Symbolic Toolbox (R2008b) or higher, you can use the ASSUME function from MuPad as follows:
syms x
evalin(symengine,'assume(x,Type::Integer)')
To remove assumptions from the variable x, you can use the following command:
syms x clear
If you are using Symbolic Toolbox (R2008a) or before, you will also need the Extended Symbolic Toolbox to do this. The Maple function ASSUME allows you to add assumptions to a symbolic variable. The following example demostrates the creation of a symbolic integer variable:
syms x
maple('assume(x,integer)');

Weitere Antworten (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by