How to obtain paths from coordinates?

조회 수: 2 (최근 30일)
Francesco
Francesco 2014년 2월 4일
댓글: Image Analyst 2014년 3월 22일
I have a .txt formatted in this way:
  댓글 수: 2
Walter Roberson
Walter Roberson 2014년 2월 4일
Are these "all the paths that are a single step", or do they include multi-step paths? Full connectivity is to be assumed?
Image Analyst
Image Analyst 2014년 3월 22일
Francesco, please don't edit your posts so as to destroy them and make people's answers meaningless and confusing. They may elect not to help you in the future if you do that.

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

채택된 답변

Walter Roberson
Walter Roberson 2014년 2월 5일
[X, Y] = ndgrid(1:N);
identifiers = arrayfun(@(X,Y) sprintf('%d_%d', X, Y), X, Y, 'Uniform', 0);
Now just remove the diagonal ones and reshape into whatever order you want.
I do not understand how you want the distance to fit into this, or why you want to generate these identifiers.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by