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
-
1513 Solvers
-
Getting the indices from a vector
6859 Solvers
-
1091 Solvers
-
364 Solvers
-
Find out sum of all elements of given Matrix
447 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!