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
-
Replace NaNs with the number that appears to its left in the row.
3019 Solvers
-
524 Solvers
-
Matlab Basics - y as a function of x
506 Solvers
-
1040 Solvers
-
1380 Solvers
More from this Author96
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!