Look and Say Sequence (Morris Sequence)
Show older comments
I am trying to implement the following sequence into Matlab using loops. The sequence is generated as follows:
V1=(1) Because it reads off V1 as "one 1" or "11"
Hence V2=(1,1)
V3=(2,1) Because it reads off V2 as "two ones" or "21"
Hence V4=(1,2,1,1) Because it reads off V3 as "one two one one" or "1211"
The sequence continues indefinitely
How can I write a script to produce this using "for" loops rather than the in-built functions?
Hence the sequence is (1),(1,1),(2,1),(1,2,1,1) and so on...
Answers (1)
Walter Roberson
on 12 Oct 2017
0 votes
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!