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
-
Find the longest sequence of 1's in a binary sequence.
5064 Solvers
-
998 Solvers
-
Find out sum and carry of Binary adder
1009 Solvers
-
Matlab Basics - y as a function of x
443 Solvers
-
491 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!