Look and Say Sequence (Morris Sequence)
이전 댓글 표시
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...
답변 (1개)
Walter Roberson
2017년 10월 12일
0 개 추천
카테고리
도움말 센터 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!