About MATLAB
- The Golden Ratio:-What is the world's most interesting number? Perhaps you like ¼, or e, or 17.
Some people might vote for Á, the golden ratio, computed here by our ¯rst Matlab
statement.
phi = (1 + sqrt(5))/2
This produces
phi =
1.6180
Let's see more digits.
format long
phi
phi =
1.61803398874989
If you have forgotten the quadratic formula, you can ask Matlab to ¯nd
the roots of the polynomial. Matlab represents a polynomial by the vector of its
coe±cients, in descending order. So the vector
p = [1 -1 -1]
represents the polynomial
p(x) = x2 ¡ x ¡ 1:
The roots are computed by the roots function.
r = roots(p)
produces
r =
-0.61803398874989
1.61803398874989
These two numbers are the only numbers whose reciprocal can be computed by
subtracting one.
ADS:
Lets see some awesome gadgets at eBay.....
Lets see some awesome gadgets at eBay.....

No comments:
Post a Comment