Difference between revisions of "MATLAB1"
Jump to navigation
Jump to search
Line 13: | Line 13: | ||
phi = (1 + sqrt(5))/2 | phi = (1 + sqrt(5))/2 | ||
</source> | </source> | ||
+ | |||
+ | <pre> | ||
+ | phi = | ||
+ | 1.6180 | ||
+ | </pre> | ||
+ | |||
+ | <source lang="matlab"> | ||
+ | format long | ||
+ | phi | ||
+ | </source> | ||
+ | |||
+ | <pre> | ||
+ | phi = | ||
+ | 1.618033988749895 | ||
+ | </pre> | ||
+ | |||
+ | φ2 − φ − 1 = 0 | ||
+ | |||
+ | <source lang="matlab"> | ||
+ | p = [1 -1 -1] | ||
+ | r = roots(p) | ||
+ | </source> | ||
+ | |||
+ | <pre> | ||
+ | r = | ||
+ | -0.618033988749895 | ||
+ | 1.618033988749895 | ||
+ | </pre> | ||
==Fibonacci Numbers== | ==Fibonacci Numbers== |
Revision as of 11:05, 7 June 2013
An Introduction MATLAB
Introduction
Getting Started: Some Arithmetic
The Golden Ratio
http://en.wikipedia.org/wiki/Golden_ratio
phi = (1 + sqrt(5))/2
phi = 1.6180
format long
phi
phi = 1.618033988749895
φ2 − φ − 1 = 0
p = [1 -1 -1]
r = roots(p)
r = -0.618033988749895 1.618033988749895