Field of numbers
MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.
MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.
Dom::Numerical is the field of numbers.
Dom::Numerical is of category
Cat::Field due to pragmatism.
This domain actually is not a field because
bool(1.0 = float(3)
/ float(3)) returns
FALSE, for example.
Dom::Numerical are usually not
created explicitly. However, if one creates elements using the usual
syntax, it is checked whether the input expression can be converted
into a number (see below).
This means that
Dom::Numerical is a façade
domain which creates elements of domain type
Every system function dealing with numbers can be applied, and computations
in this domain are performed efficiently.
Dom::Numerical has no normal representation,
0.0 both represent
Viewed as a differential ring,
trivial. It only contains constants.
Dom::Numerical(2), Dom::Numerical(2/3), Dom::Numerical(3.141), Dom::Numerical(2 + 3*I)
Constant arithmetical expressions are converted into a real
and complex floating-point number, respectively, i.e., into an element
of the domain
DOM_COMPLEX (see the function
float for details):
Dom::Numerical(exp(5)), Dom::Numerical(sin(2/3*I) + 3)
Note that the elements of this domain are elements of kernel
domains, there are no elements of the domain type
An error message is issued for non-constant arithmetical expressions:
Error: Invalid arguments. [Dom::Numerical::new]
Dom::Numerical is regarded as a field, and
it therefore can be used as a coefficient ring of polynomials or as
a component ring of matrices, for example.
We create the domain of matrices of arbitrary size (see
Dom::Matrix) with numerical
MatN := Dom::Matrix(Dom::Numerical)
Next we create a banded matrix, such as:
A := MatN(4, 4, [-PI, 0, PI], Banded)
and a row vector with four components as a 1 ×4 matrix:
v := MatN([[2, 3, -1, 0]])
Vector-matrix multiplication can be performed with the standard
v * A
Finally we compute the determinant of the matrix
using the function
D— Differential operator for numbers
See the function
D for details and further calling sequences.
diff— Differentiation of numbers
See the function
details and further calling sequences.
norm— Absolute value of numbers
random— Random number generation
testtype— Type checking
This method is called from the function