This solution is outdated. To rescore this solution, sign in.
-
2 Comments
Lavkesh
on 26 Aug 2015
Can anyone suggest how to reduce the size of the code ?
David Browne
on 6 Sep 2016
Yes there are 2 ways. You can initialise f1 as a vector [1, 1]. You also don't need the if else statement if you use start i = 1:n and then use f1(i+2) = ...
Suggested Problems
-
3353 Solvers
-
743 Solvers
-
Create matrix of replicated elements
383 Solvers
-
Area of an equilateral triangle
6512 Solvers
-
Find the Oldest Person in a Room
18689 Solvers
More from this Author96
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!