Problem 47270. Find Logic 11
Solution Stats
Problem Comments
Solution Comments
-
2 Comments
Alireza yarmohammadi
on 26 May 2021
please tell me why this code did not work
y(1)=1;
y(2)=2;
for i=3:x
y(i)=y(i-1)+y(i-2);
end
y(x)
because of that i tried another bugy way
Dyuman Joshi
on 26 May 2021
@Alireza, Check my other comment on your incorrect solution.
-
1 Comment
Dyuman Joshi
on 26 May 2021
@Alireza, Your function call is incorrect.
You are calling an array when the problem expects a single value.
Problem Recent Solvers192
Suggested Problems
-
14786 Solvers
-
Find the two most distant points
2308 Solvers
-
Maximum running product for a string of numbers
1713 Solvers
-
251 Solvers
-
982 Solvers
More from this Author40
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!