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?

采纳的回答

Catalytic
Catalytic 2022-7-19
"where the successive elements of the sequence are obtained as the concatenation of the two previous ones"
No, see -

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

标签

产品


版本

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by