How to code binary Fibonacci sequence?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Lope
el 19 de Jul. de 2022
Comentada: Lope
el 20 de Jul. de 2022
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 comentarios
Respuesta aceptada
Más respuestas (0)
Ver también
Categorías
Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!