functions
Post on 19-Dec-2015
216 views
TRANSCRIPT
Fibonacci Sequence
• Write a function that calculates the nth number in the Fibonacci Sequence
21
2
1
1
0
nnn fff
f
f
Multiple inputs and outputs
• Comments + good layout make things easier to read, correct, use and re-use.
Solving Equations
• Write a function that solves
• For real roots, otherwise displays an error.
• Also creates a plot of this function.• And displays the real roots.
02 cbxax
• Inputs:– Length of pendulum– Starting pendulum angle
• Hints:– To start just draw the pendulum in its starting
position– Use Euler rule