How to code binary Fibonacci sequence?
조회 수: 1 (최근 30일)
이전 댓글 표시
I was asked to code the binary fibonacci sequence which outputs the following: f_0={0}, f_1={1} where the successive elements of the sequence are obtained as the concatenation of the two previous ones: f_k = {f_{k-1} f_{k-2}} with k>1
f_2={1 0}
f_3={1 0 1}
f_4={1 0 1 1 0}
f_5={1 0 1 1 0 1 0 1}
f_6={1 0 1 1 0 1 0 1 1 0 1 1 0}, ...
To concatenate, I think I have to use the horzcat function. Can anyone help me with this?
댓글 수: 0
채택된 답변
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!