How to walk a volume?

조회 수: 1 (최근 30일)
John
John 2016년 1월 12일
댓글: Walter Roberson 2016년 1월 12일
A cube, side size N, I want to walk from the center going out, walking on each shell, each step can only add 1 to one direction. How to get the position index?
Example: N=4, first "shell" is the nut of N=2, 8 element; then the outer shell. with N=6 another shell. It's easy to "see" how it walk on continuously.
Is there an algorithm out there to have the walking position vectors generated automatically?
Thanks.
  댓글 수: 1
Walter Roberson
Walter Roberson 2016년 1월 12일
Is it permitted to visit any vertex twice? Is it permitted to visit the start vertex of the layer twice?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Just for fun에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by