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 Solvers219
Suggested Problems
-
Read a column of numbers and interpolate missing data
1892 Solvers
-
Project Euler: Problem 5, Smallest multiple
987 Solvers
-
954 Solvers
-
266 Solvers
-
161 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!