Graphics Reference
In-Depth Information
For example, 6 to the power of 400 with 450 exact numbers is obtained as follows:
>> ' 6 vpa ^ 400' 450
Ans =
182179771682187282513946871240893712673389715281747606674596975493339599720905327003028267800766283
867331479599455916367452421574456059646801054954062150177042349998869907885947439947961712484067309
738073652485056311556920850878594283008099992731076250733948404739350551934565743979678824151197232
629947748581376.
The result of the operation is accurate, always bring up a point at the end of the result. In this case, it was not
necessary to use 450 figures to express the result of the proposed operation. If you require a smaller number of exact
figures that actually would generate the exact result, MATLAB calculates the number requested and rounds the result and
presents it including powers of 10. For example, we will perform the above calculation only with only 50 exact figures.
>> ' 6 vpa ^ 400' 50
Ans =
.18217977168218728251394687124089371267338971528175e312
A.4 Functions with Integer Numbers and Divisibility
There are several functions in MATLAB with integer arguments, the majority of which are related to divisibility.
Among the most typical functions with integer arguments are the following:
rem (n, m)
Remainder of the division of n and m
(valid function for n and m real)
sign (n)
Sign of n (1 if n > 0, - 1 if n < 0, true)
max (n1, n2)
Maximum of n1 and n2 numbers
min (n1, n2)
Minimum of n1 and n2 numbers
gcd (n1, n2)
Greatest common divisor of n1 and n2
lcm (n1, n2)
Least common multiple of n1 and n2
factorial (n)
N factorial (n(n-1) (n-2)…)1)
factor (n)
It decomposes the n factorization
Below are some examples.
Remainder of the division of 17 by 3:
>> rem (17.3)
Ans =
2
 
Search WWH ::




Custom Search